Skip to content

Commit

Permalink
rename RDF class and property getters (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcb55 authored Oct 2, 2023
1 parent c1e916a commit 97a6720
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html

## Unreleased

- Rename RDF type Class and Property getters (to make them RDF-specific).

## 1.2.0 2023/10/01

- Fix RDF and RDFS term IRIs.
Expand Down
8 changes: 4 additions & 4 deletions src/VocabTerm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,9 @@ describe("VocabTerm tests", () => {
false,
);

expect(myTerm.isClass).toBe(false);
expect(myTerm.isRdfClass).toBe(false);
myTerm.addType(RDFS_CLASS);
expect(myTerm.isClass).toBe(true);
expect(myTerm.isRdfClass).toBe(true);
});

it("should handle rdf:type of Property", () => {
Expand All @@ -651,9 +651,9 @@ describe("VocabTerm tests", () => {
false,
);

expect(myTerm.isProperty).toBe(false);
expect(myTerm.isRdfProperty).toBe(false);
myTerm.addType(OWL_OBJECT_PROPERTY);
expect(myTerm.isProperty).toBe(true);
expect(myTerm.isRdfProperty).toBe(true);
});
});
});
4 changes: 2 additions & 2 deletions src/VocabTerm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class VocabTerm implements NamedNode {
);
}

get isClass(): boolean {
get isRdfClass(): boolean {
if (!LAZY_TYPE_RDFS_CLASS) {
this.createNamedNodeConstantsClass();
}
Expand All @@ -313,7 +313,7 @@ class VocabTerm implements NamedNode {
);
}

get isProperty(): boolean {
get isRdfProperty(): boolean {
if (!LAZY_TYPE_RDF_PROPERTY) {
this.createNamedNodeConstantsProperty();
}
Expand Down

0 comments on commit 97a6720

Please sign in to comment.