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",
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",
},
],
},

@ -5,5 +5,5 @@ import type { Cat } from "./catShape.typings";
// Compact ShapeTypes for catShape
export const CatShapeType: CompactShapeType<Cat> = {
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
*/
type: string;
type: "Cat";
/**
* Original IRI: http://example.org/name
*/

@ -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",
},
],
},

@ -5,5 +5,5 @@ import type { Person } from "./personShape.typings";
// Compact ShapeTypes for personShape
export const PersonShapeType: CompactShapeType<Person> = {
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
*/
type: string;
type: "Person";
/**
* Original IRI: http://example.org/name
*/

@ -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",
},
],
},

@ -5,5 +5,5 @@ import type { TestObject } from "./testShape.typings";
// Compact ShapeTypes for testShape
export const TestObjectShapeType: CompactShapeType<TestObject> = {
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
*/
type: string;
type: "TestObject";
/**
* Original IRI: http://example.org/stringValue
*/

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

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

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

Loading…
Cancel
Save