shape updates

main
Laurin Weger 2 weeks ago
parent c2256da436
commit bd472135e7
No known key found for this signature in database
GPG Key ID: 9B372BB0B792770F
  1. 10
      src/shapes/ldo/catShape.schema.ts
  2. 2
      src/shapes/ldo/catShape.shapeTypes.ts
  3. 2
      src/shapes/ldo/catShape.typings.ts
  4. 9
      src/shapes/ldo/personShape.schema.ts
  5. 2
      src/shapes/ldo/personShape.shapeTypes.ts
  6. 2
      src/shapes/ldo/personShape.typings.ts
  7. 14
      src/shapes/ldo/testShape.schema.ts
  8. 2
      src/shapes/ldo/testShape.shapeTypes.ts
  9. 2
      src/shapes/ldo/testShape.typings.ts
  10. 2
      src/shapes/shex/catShape.shex
  11. 4
      src/shapes/shex/personShape.shex
  12. 2
      src/shapes/shex/testShape.shex

@ -9,7 +9,7 @@ export const catShapeSchema: Schema = {
type: "Schema", type: "Schema",
shapes: [ shapes: [
{ {
id: "https://ldo.js.org/Cat", id: "http://example.org/Cat",
type: "ShapeDecl", type: "ShapeDecl",
shapeExpr: { shapeExpr: {
type: "Shape", type: "Shape",
@ -27,6 +27,7 @@ export const catShapeSchema: Schema = {
}, },
], ],
}, },
readablePredicate: "type",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -35,6 +36,7 @@ export const catShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string", datatype: "http://www.w3.org/2001/XMLSchema#string",
}, },
readablePredicate: "name",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -43,6 +45,7 @@ export const catShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#integer", datatype: "http://www.w3.org/2001/XMLSchema#integer",
}, },
readablePredicate: "age",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -51,6 +54,7 @@ export const catShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#integer", datatype: "http://www.w3.org/2001/XMLSchema#integer",
}, },
readablePredicate: "numberOfHomes",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -67,6 +71,7 @@ export const catShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string", datatype: "http://www.w3.org/2001/XMLSchema#string",
}, },
readablePredicate: "street",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -75,6 +80,7 @@ export const catShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string", datatype: "http://www.w3.org/2001/XMLSchema#string",
}, },
readablePredicate: "houseNumber",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -83,10 +89,12 @@ export const catShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#integer", datatype: "http://www.w3.org/2001/XMLSchema#integer",
}, },
readablePredicate: "floor",
}, },
], ],
}, },
}, },
readablePredicate: "address",
}, },
], ],
}, },

@ -5,5 +5,5 @@ import type { Cat } from "./catShape.typings";
// Compact ShapeTypes for catShape // Compact ShapeTypes for catShape
export const CatShapeType: CompactShapeType<Cat> = { export const CatShapeType: CompactShapeType<Cat> = {
schema: catShapeSchema, schema: catShapeSchema,
shape: "https://ldo.js.org/Cat", shape: "http://example.org/Cat",
}; };

@ -14,7 +14,7 @@ export interface Cat {
/** /**
* Original IRI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type * Original IRI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
*/ */
type: string; type: "Cat";
/** /**
* Original IRI: http://example.org/name * Original IRI: http://example.org/name
*/ */

@ -9,7 +9,7 @@ export const personShapeSchema: Schema = {
type: "Schema", type: "Schema",
shapes: [ shapes: [
{ {
id: "https://ldo.js.org/Person", id: "http://example.org/Person",
type: "ShapeDecl", type: "ShapeDecl",
shapeExpr: { shapeExpr: {
type: "Shape", type: "Shape",
@ -27,6 +27,7 @@ export const personShapeSchema: Schema = {
}, },
], ],
}, },
readablePredicate: "type",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -35,6 +36,7 @@ export const personShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string", datatype: "http://www.w3.org/2001/XMLSchema#string",
}, },
readablePredicate: "name",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -51,6 +53,7 @@ export const personShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string", datatype: "http://www.w3.org/2001/XMLSchema#string",
}, },
readablePredicate: "street",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -59,10 +62,12 @@ export const personShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string", datatype: "http://www.w3.org/2001/XMLSchema#string",
}, },
readablePredicate: "houseNumber",
}, },
], ],
}, },
}, },
readablePredicate: "address",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -71,6 +76,7 @@ export const personShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#boolean", datatype: "http://www.w3.org/2001/XMLSchema#boolean",
}, },
readablePredicate: "hasChildren",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -79,6 +85,7 @@ export const personShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#integer", datatype: "http://www.w3.org/2001/XMLSchema#integer",
}, },
readablePredicate: "numberOfHouses",
}, },
], ],
}, },

@ -5,5 +5,5 @@ import type { Person } from "./personShape.typings";
// Compact ShapeTypes for personShape // Compact ShapeTypes for personShape
export const PersonShapeType: CompactShapeType<Person> = { export const PersonShapeType: CompactShapeType<Person> = {
schema: personShapeSchema, schema: personShapeSchema,
shape: "https://ldo.js.org/Person", shape: "http://example.org/Person",
}; };

@ -14,7 +14,7 @@ export interface Person {
/** /**
* Original IRI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type * Original IRI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
*/ */
type: string; type: "Person";
/** /**
* Original IRI: http://example.org/name * Original IRI: http://example.org/name
*/ */

@ -9,7 +9,7 @@ export const testShapeSchema: Schema = {
type: "Schema", type: "Schema",
shapes: [ shapes: [
{ {
id: "https://ldo.js.org/TestObject", id: "http://example.org/TestObject",
type: "ShapeDecl", type: "ShapeDecl",
shapeExpr: { shapeExpr: {
type: "Shape", type: "Shape",
@ -27,6 +27,7 @@ export const testShapeSchema: Schema = {
}, },
], ],
}, },
readablePredicate: "type",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -35,6 +36,7 @@ export const testShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string", datatype: "http://www.w3.org/2001/XMLSchema#string",
}, },
readablePredicate: "stringValue",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -43,6 +45,7 @@ export const testShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#integer", datatype: "http://www.w3.org/2001/XMLSchema#integer",
}, },
readablePredicate: "numValue",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -51,6 +54,7 @@ export const testShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#boolean", datatype: "http://www.w3.org/2001/XMLSchema#boolean",
}, },
readablePredicate: "boolValue",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -61,6 +65,7 @@ export const testShapeSchema: Schema = {
}, },
min: 0, min: 0,
max: -1, max: -1,
readablePredicate: "arrayValue",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -77,6 +82,7 @@ export const testShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string", datatype: "http://www.w3.org/2001/XMLSchema#string",
}, },
readablePredicate: "nestedString",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -85,6 +91,7 @@ export const testShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#integer", datatype: "http://www.w3.org/2001/XMLSchema#integer",
}, },
readablePredicate: "nestedNum",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -95,10 +102,12 @@ export const testShapeSchema: Schema = {
}, },
min: 0, min: 0,
max: -1, max: -1,
readablePredicate: "nestedArray",
}, },
], ],
}, },
}, },
readablePredicate: "objectValue",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -115,6 +124,7 @@ export const testShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string", datatype: "http://www.w3.org/2001/XMLSchema#string",
}, },
readablePredicate: "prop1",
}, },
{ {
type: "TripleConstraint", type: "TripleConstraint",
@ -123,12 +133,14 @@ export const testShapeSchema: Schema = {
type: "NodeConstraint", type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#integer", datatype: "http://www.w3.org/2001/XMLSchema#integer",
}, },
readablePredicate: "prop2",
}, },
], ],
}, },
}, },
min: 0, min: 0,
max: -1, max: -1,
readablePredicate: "anotherObject",
}, },
], ],
}, },

@ -5,5 +5,5 @@ import type { TestObject } from "./testShape.typings";
// Compact ShapeTypes for testShape // Compact ShapeTypes for testShape
export const TestObjectShapeType: CompactShapeType<TestObject> = { export const TestObjectShapeType: CompactShapeType<TestObject> = {
schema: testShapeSchema, schema: testShapeSchema,
shape: "https://ldo.js.org/TestObject", shape: "http://example.org/TestObject",
}; };

@ -14,7 +14,7 @@ export interface TestObject {
/** /**
* Original IRI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type * Original IRI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
*/ */
type: string; type: "TestObject";
/** /**
* Original IRI: http://example.org/stringValue * Original IRI: http://example.org/stringValue
*/ */

@ -1,7 +1,7 @@
PREFIX ex: <http://example.org/> PREFIX ex: <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
<Cat> { ex:Cat {
a ["Cat"] ; a ["Cat"] ;
ex:name xsd:string ; ex:name xsd:string ;
ex:age xsd:integer ; ex:age xsd:integer ;

@ -1,7 +1,7 @@
PREFIX ex: <http://example.org/> PREFIX ex: <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
<Person> { ex:Person {
a ["Person"] ; a ["Person"] ;
ex:name xsd:string ; ex:name xsd:string ;
ex:address { ex:address {
@ -9,6 +9,6 @@ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ex:houseNumber xsd:string ex:houseNumber xsd:string
} ; } ;
ex:hasChildren xsd:boolean ; ex:hasChildren xsd:boolean ;
ex:numberOfHouses xsd:integer ex:numberOfHouses xsd:integer ;
} }

@ -1,7 +1,7 @@
PREFIX ex: <http://example.org/> PREFIX ex: <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
<TestObject> { ex:TestObject {
a ["TestObject"] ; a ["TestObject"] ;
ex:stringValue xsd:string ; ex:stringValue xsd:string ;
ex:numValue xsd:integer ; ex:numValue xsd:integer ;

Loading…
Cancel
Save