Skip to content

Fix usage of GraphUtils.exactlyOneProperty throughout the codebase #3880

@larsw

Description

@larsw

Change

As far as I can tell, the GraphUtils.exactlyOneProperty function is only used correctly one place in the codebase (

exactlyOneProperty(root, VocabTDB1.pDescription) ;
), the rest of the call sites assume that the function may actually return false, something it will never do; it will either return true or raise either PropertyRequiredException or NotUniqueException.

I suggest that the function is marked as deprecated, and a new one named assertExactlyOneProperty is used instead (that returns void - or raises one of the two aformentioned exceptions), and use that one internally in the codebase instead. External consumers of the existing function should be told to stop using the current function and migrate to the new one.

Are you interested in contributing a pull request for this task?

Yes

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions