From 91c6439df0ee8b89371c02fd7cabd3d8b539039f Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Thu, 30 Mar 2023 13:03:16 +0200 Subject: [PATCH 1/4] Add new Subject class predicates to declaration list --- executor/src/core/Perspective.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/executor/src/core/Perspective.ts b/executor/src/core/Perspective.ts index 04fa02fdc..4e1035be8 100644 --- a/executor/src/core/Perspective.ts +++ b/executor/src/core/Perspective.ts @@ -869,8 +869,14 @@ export default class Perspective { lines.push(":- dynamic property/2.") lines.push(":- dynamic property_getter/4.") lines.push(":- dynamic property_setter/3.") + lines.push(":- dynamic property_resolve/2.") + lines.push(":- dynamic property_resolve_language/3.") + lines.push(":- dynamic property_named_option/4.") lines.push(":- dynamic collection_getter/4.") lines.push(":- dynamic collection_setter/3.") + lines.push(":- dynamic p3_class_icon/2.") + lines.push(":- dynamic p3_class_color/2.") + lines.push(":- dynamic p3_instance_color/3.") lines.push(":- discontiguous subject_class/2.") lines.push(":- discontiguous constructor/2.") @@ -878,8 +884,14 @@ export default class Perspective { lines.push(":- discontiguous property/2.") lines.push(":- discontiguous property_getter/4.") lines.push(":- discontiguous property_setter/3.") + lines.push(":- discontiguous property_resolve/2.") + lines.push(":- discontiguous property_resolve_language/3.") + lines.push(":- discontiguous property_named_option/4.") lines.push(":- discontiguous collection_getter/4.") lines.push(":- discontiguous collection_setter/3.") + lines.push(":- discontiguous p3_class_icon/2.") + lines.push(":- discontiguous p3_class_color/2.") + lines.push(":- discontiguous p3_instance_color/3.") for(let linkExpression of allLinks) { let link = linkExpression.data From aefdef6e7290dd1dd55c263acd799ffc7d79a3c3 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Thu, 30 Mar 2023 21:36:25 +0200 Subject: [PATCH 2/4] Prevent error when getting "ExpressionRendered" on a literal expression --- executor/src/core/graphQL-interface/GraphQL.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/executor/src/core/graphQL-interface/GraphQL.ts b/executor/src/core/graphQL-interface/GraphQL.ts index d5d3cbeee..d38a21987 100644 --- a/executor/src/core/graphQL-interface/GraphQL.ts +++ b/executor/src/core/graphQL-interface/GraphQL.ts @@ -949,6 +949,11 @@ function createResolvers(core: PerspectivismCore, config: OuterConfig) { language: async (expression) => { //console.log("GQL LANGUAGE", expression) let lang + + if(expression.ref.language.address === "literal") { + return { address: "literal", name: "literal" } + } + try { lang = await core.languageController.languageForExpression(expression.ref) as any } catch(e) { From 83c4dbad92f19aa5fccdc445776a6a5e64ad1e24 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Fri, 31 Mar 2023 12:49:55 +0200 Subject: [PATCH 3/4] Fix expression->get on a string literal --- executor/src/core/LanguageController.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/executor/src/core/LanguageController.ts b/executor/src/core/LanguageController.ts index 1affd9c11..82b3e1d94 100644 --- a/executor/src/core/LanguageController.ts +++ b/executor/src/core/LanguageController.ts @@ -1007,6 +1007,14 @@ export default class LanguageController { try { if(ref.language.address == "literal" || ref.language.name == 'literal') { expr = Literal.fromUrl(`literal://${ref.expression}`).get() + if(! (typeof expr === 'object')) { + expr = { + author: '', + timestamp: '', + data: expr, + proof: {} + } + } } else { const lang = this.languageForExpression(ref); if (!lang.expressionAdapter) { From 9912a0cc7a19a32953aac3b2efa50e238fe26b3a Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Mon, 3 Apr 2023 16:26:03 +0100 Subject: [PATCH 4/4] changelog --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index ca8c1d162..70dc8d188 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ This project _loosely_ adheres to [Semantic Versioning](https://semver.org/spec/ ### Added - bootstrap languages to mono repo [PR#328](https://github.com/perspect3vism/ad4m/pull/328) +- Support for new UI oriented Subject class predicates (property_named_option, p3_class_icon, etc). [PR#353](https://github.com/perspect3vism/ad4m/pull/353) ### Changed @@ -15,7 +16,7 @@ This project _loosely_ adheres to [Semantic Versioning](https://semver.org/spec/ ### Removed ### Fixed - + - Expression -> get would fail when executed on a Literal expression. [PR#353](https://github.com/perspect3vism/ad4m/pull/353) ## [0.3.4] - 27/03/2023 ### Added