Skip to content

Commit

Permalink
Changed absolute address to parametrised.
Browse files Browse the repository at this point in the history
  • Loading branch information
LadyMalande committed Nov 22, 2023
1 parent d210ecc commit 446985f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
13 changes: 7 additions & 6 deletions packages/shacl/src/tests/shapes/nestedClosedShape.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix ex: <https://example.org/>.

<https://example.org/9d55c986a6df1cfb10333bd37133352e/osobaNodeShape> a sh:NodeShape;
<https://example.org/bfe55dedc512e9e184b5194b632c1c03/adresaNodeShape> 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.
<https://example.org/b1460ef5fc0f4d6d18f472840e27c13d/adresa-popisekPropertyShape> a sh:PropertyShape;
sh:description "Adresa bydliště dané osoby"@cs;
sh:name "Adresa"@cs;
Expand Down Expand Up @@ -57,7 +57,7 @@
sh:datatype <http://www.w3.org/2001/XMLSchema#string>.
<https://example.org/734c20709639d1c179e0719bbb62668a/adresaNodeShape> sh:property <https://example.org/14f6adb526d3e0ef133bff8942ad88aa/stat-popisekPropertyShape>.
<https://example.org/b1460ef5fc0f4d6d18f472840e27c13d/adresa-popisekPropertyShape> sh:node <https://example.org/734c20709639d1c179e0719bbb62668a/adresaNodeShape>.
<https://example.org/9d55c986a6df1cfb10333bd37133352e/osobaNodeShape> sh:property <https://example.org/b1460ef5fc0f4d6d18f472840e27c13d/adresa-popisekPropertyShape>.
<https://example.org/bfe55dedc512e9e184b5194b632c1c03/adresaNodeShape> sh:property <https://example.org/b1460ef5fc0f4d6d18f472840e27c13d/adresa-popisekPropertyShape>.
<https://example.org/d5999314c0466e169d765b055df1e55c/jmeno-a-prijmeni-popisekPropertyShape> a sh:PropertyShape;
sh:description "Jméno a příjmení dané osoby"@cs;
sh:name "Jméno a příjmení"@cs;
Expand Down Expand Up @@ -88,7 +88,7 @@
sh:datatype <http://www.w3.org/2001/XMLSchema#string>.
<https://example.org/21c6605ec1ddb44c7492034ebbf9c28c/jmeno-a-prijmeni-popisekNodeShape> sh:property <https://example.org/b68648cdd062d7b59b33b9323a113b84/prijmeni-popisekPropertyShape>.
<https://example.org/d5999314c0466e169d765b055df1e55c/jmeno-a-prijmeni-popisekPropertyShape> sh:node <https://example.org/21c6605ec1ddb44c7492034ebbf9c28c/jmeno-a-prijmeni-popisekNodeShape>.
<https://example.org/9d55c986a6df1cfb10333bd37133352e/osobaNodeShape> sh:property <https://example.org/d5999314c0466e169d765b055df1e55c/jmeno-a-prijmeni-popisekPropertyShape>.
<https://example.org/bfe55dedc512e9e184b5194b632c1c03/adresaNodeShape> sh:property <https://example.org/d5999314c0466e169d765b055df1e55c/jmeno-a-prijmeni-popisekPropertyShape>.
<https://example.org/87ccedb536726e7f139f37054c8223dc/narozeni-a-umrti-popisekPropertyShape> a sh:PropertyShape;
sh:description "Datum narození a úmrtí dané osoby"@cs;
sh:name "Datum narození a úmrtí"@cs;
Expand All @@ -97,6 +97,7 @@
sh:path <https://example.com/Narozeni_a_umrti>.
<https://example.org/90377914e9bf36d733f16f6480fd28cc/cislo-orientacniNodeShape> a sh:NodeShape;
sh:targetObjectsOf <https://example.com/Narozeni_a_umrti>;
sh:pattern "^\\d{3}(?:[-\\s]\\d{2}){1}$";
sh:closed true;
sh:ignoredProperties (<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>);
sh:nodeKind sh:BlankNodeOrIRI;
Expand All @@ -111,4 +112,4 @@
sh:datatype <http://www.w3.org/2001/XMLSchema#date>.
<https://example.org/90377914e9bf36d733f16f6480fd28cc/cislo-orientacniNodeShape> sh:property <https://example.org/00e5693dd7c0f49d2acb654950978ffa/dodatek-cisla-orientacnihoPropertyShape>.
<https://example.org/87ccedb536726e7f139f37054c8223dc/narozeni-a-umrti-popisekPropertyShape> sh:node <https://example.org/90377914e9bf36d733f16f6480fd28cc/cislo-orientacniNodeShape>.
<https://example.org/9d55c986a6df1cfb10333bd37133352e/osobaNodeShape> sh:property <https://example.org/87ccedb536726e7f139f37054c8223dc/narozeni-a-umrti-popisekPropertyShape>.
<https://example.org/bfe55dedc512e9e184b5194b632c1c03/adresaNodeShape> sh:property <https://example.org/87ccedb536726e7f139f37054c8223dc/narozeni-a-umrti-popisekPropertyShape>.
2 changes: 1 addition & 1 deletion packages/shacl/src/tests/support/FakeDataCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
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});
Expand Down
16 changes: 8 additions & 8 deletions packages/shacl/src/tests/support/NestedClosedModelCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 446985f

Please sign in to comment.