From bd472135e7b3ecf237cb47360241503693fa6f4c Mon Sep 17 00:00:00 2001 From: Laurin Weger Date: Fri, 12 Sep 2025 14:24:02 +0300 Subject: [PATCH] shape updates --- src/shapes/ldo/catShape.schema.ts | 10 +++++++++- src/shapes/ldo/catShape.shapeTypes.ts | 2 +- src/shapes/ldo/catShape.typings.ts | 2 +- src/shapes/ldo/personShape.schema.ts | 9 ++++++++- src/shapes/ldo/personShape.shapeTypes.ts | 2 +- src/shapes/ldo/personShape.typings.ts | 2 +- src/shapes/ldo/testShape.schema.ts | 14 +++++++++++++- src/shapes/ldo/testShape.shapeTypes.ts | 2 +- src/shapes/ldo/testShape.typings.ts | 2 +- src/shapes/shex/catShape.shex | 2 +- src/shapes/shex/personShape.shex | 4 ++-- src/shapes/shex/testShape.shex | 2 +- 12 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/shapes/ldo/catShape.schema.ts b/src/shapes/ldo/catShape.schema.ts index 4457af3..35eab87 100644 --- a/src/shapes/ldo/catShape.schema.ts +++ b/src/shapes/ldo/catShape.schema.ts @@ -9,7 +9,7 @@ export const catShapeSchema: Schema = { type: "Schema", shapes: [ { - id: "https://ldo.js.org/Cat", + id: "http://example.org/Cat", type: "ShapeDecl", shapeExpr: { type: "Shape", @@ -27,6 +27,7 @@ export const catShapeSchema: Schema = { }, ], }, + readablePredicate: "type", }, { type: "TripleConstraint", @@ -35,6 +36,7 @@ export const catShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, + readablePredicate: "name", }, { type: "TripleConstraint", @@ -43,6 +45,7 @@ export const catShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#integer", }, + readablePredicate: "age", }, { type: "TripleConstraint", @@ -51,6 +54,7 @@ export const catShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#integer", }, + readablePredicate: "numberOfHomes", }, { type: "TripleConstraint", @@ -67,6 +71,7 @@ export const catShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, + readablePredicate: "street", }, { type: "TripleConstraint", @@ -75,6 +80,7 @@ export const catShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, + readablePredicate: "houseNumber", }, { type: "TripleConstraint", @@ -83,10 +89,12 @@ export const catShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#integer", }, + readablePredicate: "floor", }, ], }, }, + readablePredicate: "address", }, ], }, diff --git a/src/shapes/ldo/catShape.shapeTypes.ts b/src/shapes/ldo/catShape.shapeTypes.ts index b085bcf..6c9d4eb 100644 --- a/src/shapes/ldo/catShape.shapeTypes.ts +++ b/src/shapes/ldo/catShape.shapeTypes.ts @@ -5,5 +5,5 @@ import type { Cat } from "./catShape.typings"; // Compact ShapeTypes for catShape export const CatShapeType: CompactShapeType = { schema: catShapeSchema, - shape: "https://ldo.js.org/Cat", + shape: "http://example.org/Cat", }; diff --git a/src/shapes/ldo/catShape.typings.ts b/src/shapes/ldo/catShape.typings.ts index a7c3c46..d75ed9d 100644 --- a/src/shapes/ldo/catShape.typings.ts +++ b/src/shapes/ldo/catShape.typings.ts @@ -14,7 +14,7 @@ export interface Cat { /** * Original IRI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type */ - type: string; + type: "Cat"; /** * Original IRI: http://example.org/name */ diff --git a/src/shapes/ldo/personShape.schema.ts b/src/shapes/ldo/personShape.schema.ts index 190e894..f0ea272 100644 --- a/src/shapes/ldo/personShape.schema.ts +++ b/src/shapes/ldo/personShape.schema.ts @@ -9,7 +9,7 @@ export const personShapeSchema: Schema = { type: "Schema", shapes: [ { - id: "https://ldo.js.org/Person", + id: "http://example.org/Person", type: "ShapeDecl", shapeExpr: { type: "Shape", @@ -27,6 +27,7 @@ export const personShapeSchema: Schema = { }, ], }, + readablePredicate: "type", }, { type: "TripleConstraint", @@ -35,6 +36,7 @@ export const personShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, + readablePredicate: "name", }, { type: "TripleConstraint", @@ -51,6 +53,7 @@ export const personShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, + readablePredicate: "street", }, { type: "TripleConstraint", @@ -59,10 +62,12 @@ export const personShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, + readablePredicate: "houseNumber", }, ], }, }, + readablePredicate: "address", }, { type: "TripleConstraint", @@ -71,6 +76,7 @@ export const personShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#boolean", }, + readablePredicate: "hasChildren", }, { type: "TripleConstraint", @@ -79,6 +85,7 @@ export const personShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#integer", }, + readablePredicate: "numberOfHouses", }, ], }, diff --git a/src/shapes/ldo/personShape.shapeTypes.ts b/src/shapes/ldo/personShape.shapeTypes.ts index ebf7277..c9f06c8 100644 --- a/src/shapes/ldo/personShape.shapeTypes.ts +++ b/src/shapes/ldo/personShape.shapeTypes.ts @@ -5,5 +5,5 @@ import type { Person } from "./personShape.typings"; // Compact ShapeTypes for personShape export const PersonShapeType: CompactShapeType = { schema: personShapeSchema, - shape: "https://ldo.js.org/Person", + shape: "http://example.org/Person", }; diff --git a/src/shapes/ldo/personShape.typings.ts b/src/shapes/ldo/personShape.typings.ts index db985e9..a2d53e2 100644 --- a/src/shapes/ldo/personShape.typings.ts +++ b/src/shapes/ldo/personShape.typings.ts @@ -14,7 +14,7 @@ export interface Person { /** * Original IRI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type */ - type: string; + type: "Person"; /** * Original IRI: http://example.org/name */ diff --git a/src/shapes/ldo/testShape.schema.ts b/src/shapes/ldo/testShape.schema.ts index 66c4545..84a04eb 100644 --- a/src/shapes/ldo/testShape.schema.ts +++ b/src/shapes/ldo/testShape.schema.ts @@ -9,7 +9,7 @@ export const testShapeSchema: Schema = { type: "Schema", shapes: [ { - id: "https://ldo.js.org/TestObject", + id: "http://example.org/TestObject", type: "ShapeDecl", shapeExpr: { type: "Shape", @@ -27,6 +27,7 @@ export const testShapeSchema: Schema = { }, ], }, + readablePredicate: "type", }, { type: "TripleConstraint", @@ -35,6 +36,7 @@ export const testShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, + readablePredicate: "stringValue", }, { type: "TripleConstraint", @@ -43,6 +45,7 @@ export const testShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#integer", }, + readablePredicate: "numValue", }, { type: "TripleConstraint", @@ -51,6 +54,7 @@ export const testShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#boolean", }, + readablePredicate: "boolValue", }, { type: "TripleConstraint", @@ -61,6 +65,7 @@ export const testShapeSchema: Schema = { }, min: 0, max: -1, + readablePredicate: "arrayValue", }, { type: "TripleConstraint", @@ -77,6 +82,7 @@ export const testShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, + readablePredicate: "nestedString", }, { type: "TripleConstraint", @@ -85,6 +91,7 @@ export const testShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#integer", }, + readablePredicate: "nestedNum", }, { type: "TripleConstraint", @@ -95,10 +102,12 @@ export const testShapeSchema: Schema = { }, min: 0, max: -1, + readablePredicate: "nestedArray", }, ], }, }, + readablePredicate: "objectValue", }, { type: "TripleConstraint", @@ -115,6 +124,7 @@ export const testShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, + readablePredicate: "prop1", }, { type: "TripleConstraint", @@ -123,12 +133,14 @@ export const testShapeSchema: Schema = { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#integer", }, + readablePredicate: "prop2", }, ], }, }, min: 0, max: -1, + readablePredicate: "anotherObject", }, ], }, diff --git a/src/shapes/ldo/testShape.shapeTypes.ts b/src/shapes/ldo/testShape.shapeTypes.ts index 33ed170..8d7d260 100644 --- a/src/shapes/ldo/testShape.shapeTypes.ts +++ b/src/shapes/ldo/testShape.shapeTypes.ts @@ -5,5 +5,5 @@ import type { TestObject } from "./testShape.typings"; // Compact ShapeTypes for testShape export const TestObjectShapeType: CompactShapeType = { schema: testShapeSchema, - shape: "https://ldo.js.org/TestObject", + shape: "http://example.org/TestObject", }; diff --git a/src/shapes/ldo/testShape.typings.ts b/src/shapes/ldo/testShape.typings.ts index b41ebc2..19edc7d 100644 --- a/src/shapes/ldo/testShape.typings.ts +++ b/src/shapes/ldo/testShape.typings.ts @@ -14,7 +14,7 @@ export interface TestObject { /** * Original IRI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type */ - type: string; + type: "TestObject"; /** * Original IRI: http://example.org/stringValue */ diff --git a/src/shapes/shex/catShape.shex b/src/shapes/shex/catShape.shex index 5102f17..5751278 100644 --- a/src/shapes/shex/catShape.shex +++ b/src/shapes/shex/catShape.shex @@ -1,7 +1,7 @@ PREFIX ex: PREFIX xsd: - { +ex:Cat { a ["Cat"] ; ex:name xsd:string ; ex:age xsd:integer ; diff --git a/src/shapes/shex/personShape.shex b/src/shapes/shex/personShape.shex index e93f026..e2859e2 100644 --- a/src/shapes/shex/personShape.shex +++ b/src/shapes/shex/personShape.shex @@ -1,7 +1,7 @@ PREFIX ex: PREFIX xsd: - { +ex:Person { a ["Person"] ; ex:name xsd:string ; ex:address { @@ -9,6 +9,6 @@ PREFIX xsd: ex:houseNumber xsd:string } ; ex:hasChildren xsd:boolean ; - ex:numberOfHouses xsd:integer + ex:numberOfHouses xsd:integer ; } diff --git a/src/shapes/shex/testShape.shex b/src/shapes/shex/testShape.shex index ce79d33..a45167e 100644 --- a/src/shapes/shex/testShape.shex +++ b/src/shapes/shex/testShape.shex @@ -1,7 +1,7 @@ PREFIX ex: PREFIX xsd: - { +ex:TestObject { a ["TestObject"] ; ex:stringValue xsd:string ; ex:numValue xsd:integer ;