Manta Developers
GitHub
Menu

@manta-eu/rdf-lib/shacl-property-constraints

Reference for @manta-eu/rdf-lib/shacl-property-constraints as it is on main.

Type Aliases

ShaclAllowedValueRow

ShaclAllowedValueRow = object

One value of the sh:in list of one property shape.

Properties

path

path: string

propertyShape

propertyShape: string

value

value: string


ShaclBound

ShaclBound = "minCount" | "minLength" | "minInclusive" | "minExclusive" | "maxCount" | "maxLength" | "maxInclusive" | "maxExclusive"

A SHACL term that sets a lower or an upper number limit on a property.


ShaclPropertyConstraints

ShaclPropertyConstraints = Partial<Record<ShaclBound, number>> & object

The SHACL limits on one property path, merged over every property shape that names it.

Type Declaration

allowedValues?

optional allowedValues?: string[]

nodes

nodes: string[]

path

path: string

patterns

patterns: string[]

qualified

qualified: ShaclQualifiedLimit[]


ShaclPropertyShape

ShaclPropertyShape = ShaclShape["property"][number]


ShaclQualifiedLimit

ShaclQualifiedLimit = object

A count that applies only to the values that meet every condition, from sh:qualifiedValueShape.

Properties

conditions

conditions: object[]

path

path: string

value

value: string

maxCount?

optional maxCount?: number

minCount?

optional minCount?: number


ShaclShape

ShaclShape = SchemaInterface<typeof ShaclShapeSchema>

Variables

ShaclShapeSchema

const ShaclShapeSchema: object

The LDKit schema of a node shape in the shacl graph, with the limits of its properties.

Type Declaration

@type

readonly @type: "sh:NodeShape" = sh.NodeShape

property

readonly property: object

property.@array

readonly @array: true = true

property.@id

readonly @id: "sh:property" = sh.property

property.@optional

readonly @optional: true = true

property.@schema

readonly @schema: object

property.@schema.maxCount

readonly maxCount: object

property.@schema.maxCount.@id

readonly @id: "sh:maxCount" = term

property.@schema.maxCount.@optional

readonly @optional: true = true

property.@schema.maxCount.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.maxExclusive

readonly maxExclusive: object

property.@schema.maxExclusive.@id

readonly @id: "sh:maxExclusive" = term

property.@schema.maxExclusive.@optional

readonly @optional: true = true

property.@schema.maxExclusive.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.maxInclusive

readonly maxInclusive: object

property.@schema.maxInclusive.@id

readonly @id: "sh:maxInclusive" = term

property.@schema.maxInclusive.@optional

readonly @optional: true = true

property.@schema.maxInclusive.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.maxLength

readonly maxLength: object

property.@schema.maxLength.@id

readonly @id: "sh:maxLength" = term

property.@schema.maxLength.@optional

readonly @optional: true = true

property.@schema.maxLength.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.minCount

readonly minCount: object

property.@schema.minCount.@id

readonly @id: "sh:minCount" = term

property.@schema.minCount.@optional

readonly @optional: true = true

property.@schema.minCount.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.minExclusive

readonly minExclusive: object

property.@schema.minExclusive.@id

readonly @id: "sh:minExclusive" = term

property.@schema.minExclusive.@optional

readonly @optional: true = true

property.@schema.minExclusive.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.minInclusive

readonly minInclusive: object

property.@schema.minInclusive.@id

readonly @id: "sh:minInclusive" = term

property.@schema.minInclusive.@optional

readonly @optional: true = true

property.@schema.minInclusive.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.minLength

readonly minLength: object

property.@schema.minLength.@id

readonly @id: "sh:minLength" = term

property.@schema.minLength.@optional

readonly @optional: true = true

property.@schema.minLength.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.node

readonly node: object

property.@schema.node.@array

readonly @array: true = true

property.@schema.node.@id

readonly @id: "sh:node" = sh.node

property.@schema.node.@optional

readonly @optional: true = true

property.@schema.node.@type

readonly @type: "ldkit:IRI" = ldkit.IRI

property.@schema.path

readonly path: object

property.@schema.path.@id

readonly @id: "sh:path" = sh.path

property.@schema.path.@type

readonly @type: "ldkit:IRI" = ldkit.IRI

property.@schema.pattern

readonly pattern: object

property.@schema.pattern.@array

readonly @array: true = true

property.@schema.pattern.@id

readonly @id: "sh:pattern" = sh.pattern

property.@schema.pattern.@optional

readonly @optional: true = true

property.@schema.qualifiedMaxCount

readonly qualifiedMaxCount: object

property.@schema.qualifiedMaxCount.@id

readonly @id: "sh:qualifiedMaxCount" = term

property.@schema.qualifiedMaxCount.@optional

readonly @optional: true = true

property.@schema.qualifiedMaxCount.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.qualifiedMinCount

readonly qualifiedMinCount: object

property.@schema.qualifiedMinCount.@id

readonly @id: "sh:qualifiedMinCount" = term

property.@schema.qualifiedMinCount.@optional

readonly @optional: true = true

property.@schema.qualifiedMinCount.@type

readonly @type: "xsd:decimal" = xsd.decimal

property.@schema.qualifiedValueShape

readonly qualifiedValueShape: object

property.@schema.qualifiedValueShape.@id

readonly @id: "sh:qualifiedValueShape" = sh.qualifiedValueShape

property.@schema.qualifiedValueShape.@optional

readonly @optional: true = true

property.@schema.qualifiedValueShape.@schema

readonly @schema: object

property.@schema.qualifiedValueShape.@schema.property

readonly property: object

property.@schema.qualifiedValueShape.@schema.property.@array

readonly @array: true = true

property.@schema.qualifiedValueShape.@schema.property.@id

readonly @id: "sh:property" = sh.property

property.@schema.qualifiedValueShape.@schema.property.@optional

readonly @optional: true = true

property.@schema.qualifiedValueShape.@schema.property.@schema

readonly @schema: object

property.@schema.qualifiedValueShape.@schema.property.@schema.hasValue

readonly hasValue: object

property.@schema.qualifiedValueShape.@schema.property.@schema.hasValue.@id

readonly @id: "sh:hasValue" = sh.hasValue

property.@schema.qualifiedValueShape.@schema.property.@schema.hasValue.@optional

readonly @optional: true = true

property.@schema.qualifiedValueShape.@schema.property.@schema.path

readonly path: object

property.@schema.qualifiedValueShape.@schema.property.@schema.path.@id

readonly @id: "sh:path" = sh.path

property.@schema.qualifiedValueShape.@schema.property.@schema.path.@type

readonly @type: "ldkit:IRI" = ldkit.IRI

Functions

buildShaclAllowedValuesQuery()

buildShaclAllowedValuesQuery(shapeIri): string

Gives one row per sh:in value of the shape’s properties; an LDKit schema cannot read an RDF list.

Parameters

shapeIri

string

Returns

string


mergeShaclPropertyConstraints()

mergeShaclPropertyConstraints(shape, allowedValueRows): Map<string, ShaclPropertyConstraints>

Merges the property shapes by path; a value must satisfy every property shape, so the tightest limit wins.

Parameters

shape

ShaclShape

allowedValueRows

ShaclAllowedValueRow[]

Returns

Map<string, ShaclPropertyConstraints>