diff --git a/packages/shacl/src/tests/shacl-simpleObjectShapePositive.spec.ts b/packages/shacl/src/tests/shacl-simpleObjectShapePositive.spec.ts index 8744b4178..df08ce914 100644 --- a/packages/shacl/src/tests/shacl-simpleObjectShapePositive.spec.ts +++ b/packages/shacl/src/tests/shacl-simpleObjectShapePositive.spec.ts @@ -1,6 +1,5 @@ import * as Support from "./support/testSupport"; import SimpleObjectModelCreator from "./support/SimpleObjectModelCreator"; -import generate, {fromJsonToTurtle} from "./support/FakeDataCreator"; const testType = "simpleObject"; const modelCreator = new SimpleObjectModelCreator(); diff --git a/packages/shacl/src/tests/shapes/nestedClosedShape.ttl b/packages/shacl/src/tests/shapes/nestedClosedShape.ttl index c6720087e..be6cbc4cc 100644 --- a/packages/shacl/src/tests/shapes/nestedClosedShape.ttl +++ b/packages/shacl/src/tests/shapes/nestedClosedShape.ttl @@ -2,10 +2,10 @@ @prefix rdfs: . @prefix ex: . - a sh:NodeShape; + a sh:NodeShape; sh:nodeKind sh:BlankNodeOrIRI; - sh:description "Class 1 Popisek 1"@cs; - sh:name "Class 1 Label 1"@cs. + sh:description "Adresa popis"@cs; + sh:name "Adresa"@cs. a sh:PropertyShape; sh:description "Adresa bydliště dané osoby"@cs; sh:name "Adresa"@cs; @@ -57,7 +57,7 @@ sh:datatype . sh:property . sh:node . - sh:property . + sh:property . a sh:PropertyShape; sh:description "Jméno a příjmení dané osoby"@cs; sh:name "Jméno a příjmení"@cs; @@ -88,7 +88,7 @@ sh:datatype . sh:property . sh:node . - sh:property . + sh:property . a sh:PropertyShape; sh:description "Datum narození a úmrtí dané osoby"@cs; sh:name "Datum narození a úmrtí"@cs; @@ -97,6 +97,7 @@ sh:path . a sh:NodeShape; sh:targetObjectsOf ; + sh:pattern "^\\d{3}(?:[-\\s]\\d{2}){1}$"; sh:closed true; sh:ignoredProperties (); sh:nodeKind sh:BlankNodeOrIRI; @@ -111,4 +112,4 @@ sh:datatype . sh:property . sh:node . - sh:property . + sh:property . diff --git a/packages/shacl/src/tests/support/FakeDataCreator.ts b/packages/shacl/src/tests/support/FakeDataCreator.ts index 2dbf964cb..ef2826eca 100644 --- a/packages/shacl/src/tests/support/FakeDataCreator.ts +++ b/packages/shacl/src/tests/support/FakeDataCreator.ts @@ -7,7 +7,7 @@ import * as fs from "fs"; // TODO: Parsing raw Json data to Nquads changes simple decimal containing floating point to number containing exponent E, which is not a decimal number export async function generate(fileName : string) : Promise { - const schema = fs.readFileSync('./src/tests/data/allPrimitiveDatatypesSchema.json', + const schema = fs.readFileSync(fileName, { encoding: 'utf8', flag: 'r' }); const json = JSON.parse(schema); JSONSchemaFaker.option({requiredOnly: true}); diff --git a/packages/shacl/src/tests/support/NestedClosedModelCreator.ts b/packages/shacl/src/tests/support/NestedClosedModelCreator.ts index 13e6a0eb1..c57ad8c87 100644 --- a/packages/shacl/src/tests/support/NestedClosedModelCreator.ts +++ b/packages/shacl/src/tests/support/NestedClosedModelCreator.ts @@ -179,7 +179,7 @@ class NestedClosedModelCreator implements ModelCreator{ class4.pimIri = "https://slovník.gov.cz/legislativní/sbírka/111/2009/pojem/číslo-orientační"; class4.properties = [birthdate]; class4.psmIri = "https://slovník.gov.cz/legislativní/sbírka/111/2009/pojem/číslo-orientační"; - class4.regex = null; + class4.regex = "^\\d{3}(?:[-\\s]\\d{2}){1}$"; class4.isClosed = true; class4.specification = null; class4.structureSchema = null; @@ -267,19 +267,19 @@ class NestedClosedModelCreator implements ModelCreator{ var class1 : StructureModelClass; class1 = new StructureModelClass(); - class1.cimIri = "https://example.com/class1/mojeCimIri"; - class1.codelistUrl = ["https://example.com/class1/codelistIri"]; + class1.cimIri = "https://slovník.gov.cz/legislativní/sbírka/111/2009/pojem/adresa"; + class1.codelistUrl = ["https://slovník.gov.cz/legislativní/sbírka/111/2009/pojem/adresa"]; class1.example = null; //class1.extends = null; - class1.humanDescription = {["cs"]: "Class 1 Popisek 1"}; - class1.humanLabel = {["cs"]: "Class 1 Label 1"}; - class1.pimIri = "https://example.com/class1/mojePimIri"; + class1.humanDescription = {["cs"]: "Adresa popis"}; + class1.humanLabel = {["cs"]: "Adresa"}; + class1.pimIri = "https://slovník.gov.cz/legislativní/sbírka/111/2009/pojem/adresa"; class1.properties = [property1, property2, property3]; - class1.psmIri = "https://example.com/class1/mojePsmIri"; + class1.psmIri = "https://slovník.gov.cz/legislativní/sbírka/111/2009/pojem/adresa"; class1.regex = null; class1.specification = null; class1.structureSchema = null; - class1.technicalLabel = "osoba"; + class1.technicalLabel = "adresa"; var root1 : StructureModelSchemaRoot; root1 = new StructureModelSchemaRoot();