Skip to content

Commit

Permalink
Fix toRDF event names.
Browse files Browse the repository at this point in the history
- `relative property reference` event renamed to `relative predicate
  reference`.
- `relative type reference` event renamed to `relative object
  reference`.
  • Loading branch information
davidlehn committed Aug 29, 2022
1 parent 04cdf49 commit f4055ad
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# jsonld ChangeLog

## 8.1.0 - 2022-xx-xx

### Fixed
- `relative property reference` event renamed to `relative predicate
reference`.
- `relative type reference` event renamed to `relative object reference`.

## 8.0.0 - 2022-08-23

### Changed
Expand Down
6 changes: 3 additions & 3 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ const _notSafeEventCodes = new Set([
// toRDF
'blank node predicate',
'relative graph reference',
'relative property reference',
'relative subject reference',
'relative type reference'
'relative object reference',
'relative predicate reference',
'relative subject reference'
]);

// safe handler that rejects unsafe warning conditions
Expand Down
12 changes: 6 additions & 6 deletions lib/toRdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ function _graphToRDF(dataset, graph, graphTerm, issuer, options) {
_handleEvent({
event: {
type: ['JsonLdEvent'],
code: 'relative property reference',
code: 'relative predicate reference',
level: 'warning',
message: 'Relative property reference found.',
message: 'Relative predicate reference found.',
details: {
property
predicate: property
}
},
options
Expand Down Expand Up @@ -345,11 +345,11 @@ function _objectToRDF(
_handleEvent({
event: {
type: ['JsonLdEvent'],
code: 'relative type reference',
code: 'relative object reference',
level: 'warning',
message: 'Relative type reference found.',
message: 'Relative object reference found.',
details: {
type: object.value
object: object.value
}
},
options
Expand Down
8 changes: 4 additions & 4 deletions tests/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3272,7 +3272,7 @@ _:b0 <ex:p> "v" .
});
});

it('should handle relative property reference', async () => {
it('should handle relative predicate reference', async () => {
const input =
[
{
Expand All @@ -3293,14 +3293,14 @@ _:b0 <ex:p> "v" .
options: {skipExpansion: true},
expected: nq,
eventCodeLog: [
'relative property reference'
'relative predicate reference'
// .. 'rel'
],
testNotSafe: true
});
});

it('should handle relative property reference', async () => {
it('should handle relative object reference', async () => {
const input =
[
{
Expand All @@ -3325,7 +3325,7 @@ _:b0 <ex:p> "v" .
options: {skipExpansion: true},
expected: nq,
eventCodeLog: [
'relative type reference'
'relative object reference'
// .. 'rel'
],
testNotSafe: true
Expand Down

0 comments on commit f4055ad

Please sign in to comment.