From be6e2ff325b2a9f750973bbba5cff59f73975d6d Mon Sep 17 00:00:00 2001 From: Pat McBennett Date: Sun, 1 Oct 2023 23:45:19 +0100 Subject: [PATCH 1/2] Release (#1009) * update CHANGELOG for new minor release * 1.1.0 --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c67d2e9..6af3bb6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## Unreleased +## 1.1.0 2023/10/01 + - Add the ability to retrieve all the RDF:type values for any vocab term. - Add convenience methods to ask if a vocab term is a Class or a Property (using RDF, RDFS, and OWL definitions of Class and Property). diff --git a/package-lock.json b/package-lock.json index 5455b11a..1ca85806 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@inrupt/solid-common-vocab", - "version": "1.0.1", + "version": "1.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@inrupt/solid-common-vocab", - "version": "1.0.1", + "version": "1.1.0", "license": "MIT", "dependencies": { "@rdfjs/types": "^1.1.0" diff --git a/package.json b/package.json index 51e4fc4e..d3b38ee1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@inrupt/solid-common-vocab", - "version": "1.0.1", + "version": "1.1.0", "description": "Implementation of Solid Common Vocab, with minimal RDF library dependencies.", "main": "dist/index.js", "module": "dist/index.es.js", From 434d71a8c62f4024ac592436d304f6fb60546c63 Mon Sep 17 00:00:00 2001 From: Pat McBennett Date: Mon, 2 Oct 2023 00:39:56 +0100 Subject: [PATCH 2/2] fix RDF and RDFS term IRIs (#1010) --- CHANGELOG.md | 2 ++ src/VocabTerm.test.ts | 6 +++--- src/VocabTerm.ts | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6af3bb6c..79aacc02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## Unreleased +- Fix RDF and RDFS term IRIs. + ## 1.1.0 2023/10/01 - Add the ability to retrieve all the RDF:type values for any vocab term. diff --git a/src/VocabTerm.test.ts b/src/VocabTerm.test.ts index f02bff95..2b0f6177 100755 --- a/src/VocabTerm.test.ts +++ b/src/VocabTerm.test.ts @@ -627,8 +627,8 @@ describe("VocabTerm tests", () => { }); it("should handle rdf:type of Class", () => { - const RDF_CLASS = rdfFactory.namedNode( - "http://www.w3.org/1999/02/22-rdf-syntax-ns#Class", + const RDFS_CLASS = rdfFactory.namedNode( + "http://www.w3.org/2000/01/rdf-schema#Class", ); const myTerm = buildBasicTerm( "http://some.vocab#myTerm", @@ -637,7 +637,7 @@ describe("VocabTerm tests", () => { ); expect(myTerm.isClass).toBe(false); - myTerm.addType(RDF_CLASS); + myTerm.addType(RDFS_CLASS); expect(myTerm.isClass).toBe(true); }); diff --git a/src/VocabTerm.ts b/src/VocabTerm.ts index bfeca9c9..6dd30a46 100755 --- a/src/VocabTerm.ts +++ b/src/VocabTerm.ts @@ -42,10 +42,10 @@ const DEFAULT_LOCALE = "en"; // We need an instance of an RDF Factory to instantiate a Named Node, but we // only want to create instances of these RDF types if we are checking for the // -let LAZY_TYPE_RDF_CLASS: NamedNode | undefined = undefined; +let LAZY_TYPE_RDFS_CLASS: NamedNode | undefined = undefined; let LAZY_TYPE_OWL_CLASS: NamedNode | undefined = undefined; -let LAZY_TYPE_RDFS_PROPERTY: NamedNode | undefined = undefined; +let LAZY_TYPE_RDF_PROPERTY: NamedNode | undefined = undefined; let LAZY_TYPE_OWL_DATATYPE_PROPERTY: NamedNode | undefined = undefined; let LAZY_TYPE_OWL_OBJECT_PROPERTY: NamedNode | undefined = undefined; let LAZY_TYPE_OWL_ANNOTATION_PROPERTY: NamedNode | undefined = undefined; @@ -266,8 +266,8 @@ class VocabTerm implements NamedNode { } createNamedNodeConstantsClass(): void { - LAZY_TYPE_RDF_CLASS = this.rdfFactory.namedNode( - "http://www.w3.org/1999/02/22-rdf-syntax-ns#Class", + LAZY_TYPE_RDFS_CLASS = this.rdfFactory.namedNode( + "http://www.w3.org/2000/01/rdf-schema#Class", ); LAZY_TYPE_OWL_CLASS = this.rdfFactory.namedNode( @@ -276,8 +276,8 @@ class VocabTerm implements NamedNode { } createNamedNodeConstantsProperty(): void { - LAZY_TYPE_RDFS_PROPERTY = this.rdfFactory.namedNode( - "http://www.w3.org/2000/01/rdf-schema#Property", + LAZY_TYPE_RDF_PROPERTY = this.rdfFactory.namedNode( + "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", ); LAZY_TYPE_OWL_DATATYPE_PROPERTY = this.rdfFactory.namedNode( "http://www.w3.org/2002/07/owl#Property", @@ -303,23 +303,23 @@ class VocabTerm implements NamedNode { } get isClass(): boolean { - if (!LAZY_TYPE_RDF_CLASS) { + if (!LAZY_TYPE_RDFS_CLASS) { this.createNamedNodeConstantsClass(); } return ( - (this._type?.has(LAZY_TYPE_RDF_CLASS!) || + (this._type?.has(LAZY_TYPE_RDFS_CLASS!) || this._type?.has(LAZY_TYPE_OWL_CLASS!)) !== undefined ); } get isProperty(): boolean { - if (!LAZY_TYPE_RDFS_PROPERTY) { + if (!LAZY_TYPE_RDF_PROPERTY) { this.createNamedNodeConstantsProperty(); } return ( - (this._type?.has(LAZY_TYPE_RDFS_PROPERTY!) || + (this._type?.has(LAZY_TYPE_RDF_PROPERTY!) || this._type?.has(LAZY_TYPE_OWL_OBJECT_PROPERTY!) || this._type?.has(LAZY_TYPE_OWL_DATATYPE_PROPERTY!) || this._type?.has(LAZY_TYPE_OWL_ANNOTATION_PROPERTY!) ||