Skip to content

Commit

Permalink
support sh:hasValue
Browse files Browse the repository at this point in the history
  • Loading branch information
s-tittel committed Aug 3, 2023
1 parent 24b4fe3 commit 4dd11a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,17 @@ export class ShaclProperty extends HTMLElement {
});
this.appendChild(this.addButton)

const hasValue = findObjectByPredicate(this.quads, 'hasValue')
const values = valueSubject ? form.config.dataGraph.getQuads(valueSubject, this.path, null, null) : []
let valuesContainHasValue = false
for (const value of values) {
this.createPropertyInstance(value.object)
if (hasValue && value.object.equals(hasValue)) {
valuesContainHasValue = true
}
}
if (hasValue && !valuesContainHasValue) {
this.createPropertyInstance(hasValue)
}

this.updateControls()
Expand Down

0 comments on commit 4dd11a4

Please sign in to comment.