From b9ed7e437f5e37943aeb2b7d78028c16d7ba44d3 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Mon, 18 Nov 2024 10:47:12 +0100 Subject: [PATCH 1/4] refactor: use typed NamespaceBuilder instead of ontology class --- .../app/core/ontology/blueprint/blueprint.ts | 339 ++++++++++-------- .../src/app/core/ontology/ontology.ts | 6 +- 2 files changed, 199 insertions(+), 146 deletions(-) diff --git a/projects/blueprint/src/app/core/ontology/blueprint/blueprint.ts b/projects/blueprint/src/app/core/ontology/blueprint/blueprint.ts index 461fe15..4e9ad5f 100644 --- a/projects/blueprint/src/app/core/ontology/blueprint/blueprint.ts +++ b/projects/blueprint/src/app/core/ontology/blueprint/blueprint.ts @@ -5,14 +5,67 @@ import rdfEnvironment from '@zazuko/env'; import { Ontology } from '../ontology'; -class BlueprintOntology extends Ontology { +type BlueprintTerms = + 'query' + | 'icon' + | 'UISearchResult' + | 'ns' + | 'faIcon' + | 'colorIndex' + | 'detail' + | 'showAs' + | 'label' + | 'Table' + | 'hasHeader' + | 'columnIndex' + | 'value' + | 'key' + | 'hasRow' + | 'cell' + | 'instance' + | 'child' + | 'Child' + | 'Hierarchy' + | 'linkLabel' + | 'hasRoot' + | 'showIn' + | 'searchPrio' + | 'TreeNode' + | 'score' + | 'count' + | 'result' + | 'pageSize' + | 'pageNumber' + | 'total' + | 'TreeRoot' + | 'UiClassCount' + | 'UiSearchResult' + | 'UiSearchResultItem' + | 'parent' + | 'hasUiLink' + | 'Link' + | 'link' + | 'UiNode' + | 'Container' + | 'Composition' + | 'CompositionToCompositionLink' + | 'CompositionToNodeLink' + | 'source' + | 'target' + | 'CompositionLinkResult' + | 'inverseLabel' + | 'ConnectionPoint' + +export const ns = rdfEnvironment.namespace('https://flux.described.at/'); + +class BlueprintOntology extends Ontology { constructor() { - super(rdfEnvironment.namespace('https://flux.described.at/')); + super(ns); } - get namespace(): NamespaceBuilder { - return this._namespace; + get namespace(): NamespaceBuilder { + return ns } prefix(): string { @@ -29,7 +82,7 @@ class BlueprintOntology extends Ontology { /** * Get the icon predicate. - * + * * @readonly */ get icon(): string { @@ -38,7 +91,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed icon predicate. - * + * * @readonly */ get iconPrefixed(): string { @@ -56,18 +109,18 @@ class BlueprintOntology extends Ontology { /** * Get the faIcon predicate. * @deprecated use {@link getIconPrefixed} or {@link getIcon} instead - * + * * @readonly */ get faIcon(): string { return this.namespace('faIcon').value; } - /** + /** * Get the prefixed faIcon predicate. - * + * * @deprecated use {@link getIconPrefixed} or {@link getIcon} instead - * + * * @readonly */ get faIconPrefixed(): string { @@ -76,9 +129,9 @@ class BlueprintOntology extends Ontology { /** * Get the faIcon predicate as NamedNode. - * + * * @deprecated use {@link getIconPrefixed} or {@link getIcon} instead - * + * * @readonly */ get faIconNamedNode(): NamedNode { @@ -87,7 +140,7 @@ class BlueprintOntology extends Ontology { /** * get the prefixed icon predicate - * + * * @readonly */ get colorIndex(): string { @@ -96,7 +149,7 @@ class BlueprintOntology extends Ontology { /** * get the prefixed icon predicate - * + * * @readonly */ get colorIndexPrefixed(): string { @@ -105,7 +158,7 @@ class BlueprintOntology extends Ontology { /** * Get the colorIndex predicate as NamedNode. - * + * * @readonly */ get colorIndexNamedNode(): NamedNode { @@ -121,7 +174,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed search priority predicate. - * + * * @readonly */ get searchPriorityPrefixed(): string { @@ -130,7 +183,7 @@ class BlueprintOntology extends Ontology { /** * Get the search priority predicate as NamedNode. - * + * * @readonly */ get searchPriorityNamedNode(): NamedNode { @@ -139,7 +192,7 @@ class BlueprintOntology extends Ontology { /** * @deprecated i think we don't need it anymore - * + * * @readonly */ get showIn() { @@ -148,7 +201,7 @@ class BlueprintOntology extends Ontology { /** * @deprecated i think we don't need it anymore - * + * * @readonly */ get showInPrefixed() { @@ -157,7 +210,7 @@ class BlueprintOntology extends Ontology { /** * @deprecated i think we don't need it anymore - * + * * @readonly */ get showInNamedNode(): NamedNode { @@ -166,7 +219,7 @@ class BlueprintOntology extends Ontology { /** * Get the has root predicate. - * + * * @readonly */ get hasRoot() { @@ -175,7 +228,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed has root predicate. - * + * * @readonly */ get hasRootPrefixed() { @@ -184,7 +237,7 @@ class BlueprintOntology extends Ontology { /** * Get the has root predicate as NamedNode. - * + * * @readonly */ get hasRootNamedNode(): NamedNode { @@ -193,7 +246,7 @@ class BlueprintOntology extends Ontology { /** * Get the has showAs predicate. - * + * * @readonly */ get showAs() { @@ -202,7 +255,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed has showAs predicate. - * + * * @readonly */ get showAsPrefixed() { @@ -212,7 +265,7 @@ class BlueprintOntology extends Ontology { /** * Get the has showAs predicate as NamedNode. - * + * * @readonly */ get showAsNamedNode(): NamedNode { @@ -221,7 +274,7 @@ class BlueprintOntology extends Ontology { /** * Get the has detail predicate. - * + * * @readonly */ get detail() { @@ -235,7 +288,7 @@ class BlueprintOntology extends Ontology { return `${this.prefix()}:detail`; } - /** + /** * Get the has detail predicate as NamedNode. */ get detailNamedNode(): NamedNode { @@ -244,7 +297,7 @@ class BlueprintOntology extends Ontology { /** * Get the has value predicate. - * + * * @readonly */ get value() { @@ -253,7 +306,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed has value predicate. - * + * * @readonly */ get valuePrefixed() { @@ -262,7 +315,7 @@ class BlueprintOntology extends Ontology { /** * Get the has value predicate as NamedNode. - * + * * @readonly */ get valueNamedNode(): NamedNode { @@ -272,7 +325,7 @@ class BlueprintOntology extends Ontology { // class /** * Get the Hierarchy class. - * + * * @readonly */ get Hierarchy() { @@ -281,7 +334,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed Hierarchy class. - * + * * @readonly */ get HierarchyPrefixed() { @@ -290,7 +343,7 @@ class BlueprintOntology extends Ontology { /** * Get the Hierarchy class as NamedNode. - * + * * @readonly */ get HierarchyNamedNode(): NamedNode { @@ -300,7 +353,7 @@ class BlueprintOntology extends Ontology { /** * Get linkLabel predicate. - * + * * @readonly */ get linkLabel() { @@ -309,7 +362,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed linkLabel predicate. - * + * * @readonly */ get linkLabelPrefixed() { @@ -318,7 +371,7 @@ class BlueprintOntology extends Ontology { /** * Get the linkLabel predicate as NamedNode. - * + * * @readonly */ get linkLabelNamedNode(): NamedNode { @@ -327,7 +380,7 @@ class BlueprintOntology extends Ontology { /** * Get the has label predicate. - * + * * @readonly */ get label() { @@ -336,7 +389,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed has label predicate. - * + * * @readonly */ get labelPrefixed() { @@ -345,7 +398,7 @@ class BlueprintOntology extends Ontology { /** * Get the has label predicate as NamedNode. - * + * * @readonly */ get labelNamedNode(): NamedNode { @@ -354,7 +407,7 @@ class BlueprintOntology extends Ontology { /** * Get the Table class. - * + * * @readonly */ get Table() { @@ -363,7 +416,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed Table class. - * + * * @readonly */ get TablePrefixed() { @@ -372,7 +425,7 @@ class BlueprintOntology extends Ontology { /** * Get the Table class as NamedNode. - * + * * @readonly */ get TableNamedNode(): NamedNode { @@ -381,7 +434,7 @@ class BlueprintOntology extends Ontology { /** * Get the hasHeader predicate. - * + * * @readonly */ get hasHeader() { @@ -390,7 +443,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed hasHeader predicate. - * + * * @readonly */ get hasHeaderPrefixed() { @@ -399,7 +452,7 @@ class BlueprintOntology extends Ontology { /** * Get the hasHeader predicate as NamedNode. - * + * * @readonly */ get hasHeaderNamedNode(): NamedNode { @@ -408,7 +461,7 @@ class BlueprintOntology extends Ontology { /** * Get the columnIndex predicate. - * + * * @readonly */ get columnIndex(): string { @@ -417,7 +470,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed columnIndex predicate. - * + * * @readonly */ get columnIndexPrefixed(): string { @@ -426,7 +479,7 @@ class BlueprintOntology extends Ontology { /** * Get the columnIndex predicate as NamedNode. - * + * * @readonly */ get columnIndexNamedNode(): NamedNode { @@ -435,7 +488,7 @@ class BlueprintOntology extends Ontology { /** * Get the key predicate. - * + * * @readonly */ get key(): string { @@ -444,7 +497,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed key predicate. - * + * * @readonly */ get keyPrefixed(): string { @@ -453,7 +506,7 @@ class BlueprintOntology extends Ontology { /** * Get the key predicate as NamedNode. - * + * * @readonly */ get keyNamedNode(): NamedNode { @@ -462,7 +515,7 @@ class BlueprintOntology extends Ontology { /** * Get the hasRow predicate. - * + * * @readonly */ get hasRow(): string { @@ -471,7 +524,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed hasRow predicate. - * + * * @readonly */ get hasRowPrefixed(): string { @@ -480,7 +533,7 @@ class BlueprintOntology extends Ontology { /** * Get the hasRow predicate as NamedNode. - * + * * @readonly */ get hasRowNamedNode(): NamedNode { @@ -489,7 +542,7 @@ class BlueprintOntology extends Ontology { /** * Get the cell predicate. - * + * * @readonly */ get cell(): string { @@ -498,7 +551,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed cell predicate. - * + * * @readonly */ get cellPrefixed(): string { @@ -507,7 +560,7 @@ class BlueprintOntology extends Ontology { /** * Get the cell predicate as NamedNode. - * + * * @readonly */ get cellNamedNode(): NamedNode { @@ -516,7 +569,7 @@ class BlueprintOntology extends Ontology { /** * Get the instance predicate. - * + * * @readonly */ get instance(): string { @@ -525,7 +578,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed instance predicate. - * + * * @readonly */ get instancePrefixed(): string { @@ -534,7 +587,7 @@ class BlueprintOntology extends Ontology { /** * Get the instance predicate as NamedNode. - * + * * @readonly */ get instanceNamedNode(): NamedNode { @@ -543,7 +596,7 @@ class BlueprintOntology extends Ontology { /** * Get the child predicate. - * + * * @readonly */ get child(): string { @@ -552,7 +605,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed child predicate. - * + * * @readonly */ get childPrefixed(): string { @@ -561,7 +614,7 @@ class BlueprintOntology extends Ontology { /** * Get the child predicate as NamedNode. - * + * * @readonly */ get childNamedNode(): NamedNode { @@ -577,7 +630,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed Child class. - * + * * @readonly */ get ChildPrefixed(): string { @@ -586,7 +639,7 @@ class BlueprintOntology extends Ontology { /** * Get the Child class as NamedNode. - * + * * @readonly */ get ChildNamedNode(): NamedNode { @@ -602,7 +655,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed TreeNode class. - * + * * @readonly */ get TreeNodePrefixed(): string { @@ -611,7 +664,7 @@ class BlueprintOntology extends Ontology { /** * Get the TreeNode class as NamedNode. - * + * * @readonly */ get TreeNodeNamedNode(): NamedNode { @@ -620,7 +673,7 @@ class BlueprintOntology extends Ontology { /** * Get the TreeRoot class. - * + * * @readonly */ get TreeRoot(): string { @@ -629,7 +682,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed TreeRoot class. - * + * * @readonly */ get TreeRootPrefixed(): string { @@ -638,7 +691,7 @@ class BlueprintOntology extends Ontology { /** * Get the TreeRoot class as NamedNode. - * + * * @readonly */ get TreeRootNamedNode(): NamedNode { @@ -647,7 +700,7 @@ class BlueprintOntology extends Ontology { /** * Get the score predicate. - * + * * @readonly */ get score(): string { @@ -656,7 +709,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed score predicate. - * + * * @readonly */ get scorePrefixed(): string { @@ -665,7 +718,7 @@ class BlueprintOntology extends Ontology { /** * Get the score predicate as NamedNode. - * + * * @readonly */ get scoreNamedNode(): NamedNode { @@ -674,7 +727,7 @@ class BlueprintOntology extends Ontology { /** * Get the count predicate. - * + * * @readonly */ get count(): string { @@ -683,7 +736,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed count predicate. - * + * * @readonly */ get countPrefixed(): string { @@ -692,7 +745,7 @@ class BlueprintOntology extends Ontology { /** * Get the count predicate as NamedNode. - * + * * @readonly */ get countNamedNode(): NamedNode { @@ -701,7 +754,7 @@ class BlueprintOntology extends Ontology { /** * Get the result predicate. - * + * * @readonly */ get result(): string { @@ -710,7 +763,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed result predicate. - * + * * @readonly */ get resultPrefixed(): string { @@ -719,7 +772,7 @@ class BlueprintOntology extends Ontology { /** * Get the result predicate as NamedNode. - * + * * @readonly */ get resultNamedNode(): NamedNode { @@ -728,7 +781,7 @@ class BlueprintOntology extends Ontology { /** * Get the pageSize predicate. - * + * * @readonly */ get pageSize(): string { @@ -737,7 +790,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed pageSize predicate. - * + * * @readonly */ get pageSizePrefixed(): string { @@ -746,7 +799,7 @@ class BlueprintOntology extends Ontology { /** * Get the pageSize predicate as NamedNode. - * + * * @readonly */ get pageSizeNamedNode(): NamedNode { @@ -755,7 +808,7 @@ class BlueprintOntology extends Ontology { /** * Get the pageNumber predicate. - * + * * @readonly */ get pageNumber(): string { @@ -764,7 +817,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed pageNumber predicate. - * + * * @readonly */ get pageNumberPrefixed(): string { @@ -773,7 +826,7 @@ class BlueprintOntology extends Ontology { /** * Get the pageNumber predicate as NamedNode. - * + * * @readonly */ get pageNumberNamedNode(): NamedNode { @@ -782,7 +835,7 @@ class BlueprintOntology extends Ontology { /** * Get the total predicate. - * + * * @readonly */ get total(): string { @@ -791,7 +844,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed total predicate. - * + * * @readonly */ get totalPrefixed(): string { @@ -800,7 +853,7 @@ class BlueprintOntology extends Ontology { /** * Get the total predicate as NamedNode. - * + * * @readonly */ get totalNamedNode(): NamedNode { @@ -809,7 +862,7 @@ class BlueprintOntology extends Ontology { /** * Get the query predicate. - * + * * @readonly */ get query(): string { @@ -818,7 +871,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed query predicate. - * + * * @readonly */ get queryPrefixed(): string { @@ -827,7 +880,7 @@ class BlueprintOntology extends Ontology { /** * Get the query predicate as NamedNode. - * + * * @readonly */ get queryNamedNode(): NamedNode { @@ -836,7 +889,7 @@ class BlueprintOntology extends Ontology { /** * Get the UiClassCount class. - * + * * @readonly */ get UiClassCount(): string { @@ -845,7 +898,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed UiClassCount class. - * + * * @readonly */ get UiClassCountPrefixed(): string { @@ -854,7 +907,7 @@ class BlueprintOntology extends Ontology { /** * Get the UiClassCount class as NamedNode. - * + * * @readonly */ get UiClassCountNamedNode(): NamedNode { @@ -863,7 +916,7 @@ class BlueprintOntology extends Ontology { /** * Get the UiSearchResult class. - * + * * @readonly */ get UiSearchResult(): string { @@ -872,7 +925,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed UiSearchResult class. - * + * * @readonly */ get UiSearchResultPrefixed(): string { @@ -881,7 +934,7 @@ class BlueprintOntology extends Ontology { /** * Get the UiSearchResult class as NamedNode. - * + * * @readonly */ get UiSearchResultNamedNode(): NamedNode { @@ -890,7 +943,7 @@ class BlueprintOntology extends Ontology { /** * Get the UiSearchResultItem class. - * + * * @readonly */ get UiSearchResultItem(): string { @@ -899,7 +952,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed UiSearchResultItem class. - * + * * @readonly */ get UiSearchResultItemPrefixed(): string { @@ -908,7 +961,7 @@ class BlueprintOntology extends Ontology { /** * Get the UiSearchResultItem class as NamedNode. - * + * * @readonly */ get UiSearchResultItemNamedNode(): NamedNode { @@ -917,7 +970,7 @@ class BlueprintOntology extends Ontology { /** * Get the parent predicate. - * + * * @readonly */ get parent(): string { @@ -926,7 +979,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed parent predicate. - * + * * @readonly */ get parentPrefixed(): string { @@ -935,7 +988,7 @@ class BlueprintOntology extends Ontology { /** * Get the parent predicate as NamedNode. - * + * * @readonly */ get parentNamedNode(): NamedNode { @@ -944,7 +997,7 @@ class BlueprintOntology extends Ontology { /** * Get the hasUiLink predicate. - * + * * @readonly */ get hasUiLink(): string { @@ -953,7 +1006,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed hasUiLink predicate. - * + * * @readonly */ get hasUiLinkPrefixed(): string { @@ -962,7 +1015,7 @@ class BlueprintOntology extends Ontology { /** * Get the hasUiLink predicate as NamedNode. - * + * * @readonly */ get hasUiLinkNamedNode(): NamedNode { @@ -971,7 +1024,7 @@ class BlueprintOntology extends Ontology { /** * Get the Link class. - * + * * @readonly */ get Link(): string { @@ -980,7 +1033,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed Link class. - * + * * @readonly */ get LinkPrefixed(): string { @@ -989,7 +1042,7 @@ class BlueprintOntology extends Ontology { /** * Get the Link class as NamedNode. - * + * * @readonly */ get LinkNamedNode(): NamedNode { @@ -998,7 +1051,7 @@ class BlueprintOntology extends Ontology { /** * Get the link predicate. - * + * * @readonly */ get link(): string { @@ -1007,7 +1060,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed link predicate. - * + * * @readonly */ get linkPrefixed(): string { @@ -1016,7 +1069,7 @@ class BlueprintOntology extends Ontology { /** * Get the link predicate as NamedNode. - * + * * @readonly */ get linkNamedNode(): NamedNode { @@ -1025,7 +1078,7 @@ class BlueprintOntology extends Ontology { /** * Get the UiNode class. - * + * * @readonly */ get UiNode(): string { @@ -1034,7 +1087,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed UiNode class. - * + * * @readonly */ get UiNodePrefixed(): string { @@ -1043,7 +1096,7 @@ class BlueprintOntology extends Ontology { /** * Get the UiNode class as NamedNode. - * + * * @readonly */ get UiNodeNamedNode(): NamedNode { @@ -1052,7 +1105,7 @@ class BlueprintOntology extends Ontology { /** * Get Container class. - * + * * @readonly */ get Container(): string { @@ -1061,7 +1114,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed Container class. - * + * * @readonly */ get ContainerPrefixed(): string { @@ -1070,7 +1123,7 @@ class BlueprintOntology extends Ontology { /** * Get the Container class as NamedNode. - * + * * @readonly */ get ContainerNamedNode(): NamedNode { @@ -1079,7 +1132,7 @@ class BlueprintOntology extends Ontology { /** * Get the Composition class. - * + * * @readonly */ get Composition(): string { @@ -1088,7 +1141,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed Composition class. - * + * * @readonly */ get CompositionPrefixed(): string { @@ -1097,7 +1150,7 @@ class BlueprintOntology extends Ontology { /** * Get the Composition class as NamedNode. - * + * * @readonly */ get CompositionNamedNode(): NamedNode { @@ -1106,7 +1159,7 @@ class BlueprintOntology extends Ontology { /** * Get the CompositionToCompositionLink class. - * + * * @readonly */ get CompositionToCompositionLink(): string { @@ -1115,7 +1168,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed CompositionToCompositionLink class. - * + * * @readonly */ get CompositionToCompositionLinkPrefixed(): string { @@ -1124,7 +1177,7 @@ class BlueprintOntology extends Ontology { /** * Get the CompositionToCompositionLink class as NamedNode. - * + * * @readonly */ get CompositionToCompositionLinkNamedNode(): NamedNode { @@ -1133,7 +1186,7 @@ class BlueprintOntology extends Ontology { /** * Get the CompositionToNodeLink class. - * + * * @readonly */ get CompositionToNodeLink(): string { @@ -1142,7 +1195,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed CompositionToNodeLink class. - * + * * @readonly */ get CompositionToNodeLinkPrefixed(): string { @@ -1151,7 +1204,7 @@ class BlueprintOntology extends Ontology { /** * Get the CompositionToNodeLink class as NamedNode. - * + * * @readonly */ get CompositionToNodeLinkNamedNode(): NamedNode { @@ -1160,7 +1213,7 @@ class BlueprintOntology extends Ontology { /** * Get the source predicate. - * + * * @readonly */ get source(): string { @@ -1169,7 +1222,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed source predicate. - * + * * @readonly */ get sourcePrefixed(): string { @@ -1178,7 +1231,7 @@ class BlueprintOntology extends Ontology { /** * Get the source predicate as NamedNode. - * + * * @readonly */ get sourceNamedNode(): NamedNode { @@ -1187,7 +1240,7 @@ class BlueprintOntology extends Ontology { /** * Get the target predicate. - * + * * @readonly */ get target(): string { @@ -1196,7 +1249,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed target predicate. - * + * * @readonly */ get targetPrefixed(): string { @@ -1205,7 +1258,7 @@ class BlueprintOntology extends Ontology { /** * Get the target predicate as NamedNode. - * + * * @readonly */ get targetNamedNode(): NamedNode { @@ -1214,7 +1267,7 @@ class BlueprintOntology extends Ontology { /** * Get the inverseLabel predicate. - * + * * @readonly */ get inverseLabel(): string { @@ -1223,7 +1276,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed inverseLabel predicate. - * + * * @readonly */ get inverseLabelPrefixed(): string { @@ -1232,7 +1285,7 @@ class BlueprintOntology extends Ontology { /** * Get the inverseLabel predicate as NamedNode. - * + * * @readonly */ get inverseLabelNamedNode(): NamedNode { @@ -1241,7 +1294,7 @@ class BlueprintOntology extends Ontology { /** * Get the ConnectionPoint class. - * + * * @readonly */ get ConnectionPoint(): string { @@ -1250,7 +1303,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed ConnectionPoint class. - * + * * @readonly */ get ConnectionPointPrefixed(): string { @@ -1259,7 +1312,7 @@ class BlueprintOntology extends Ontology { /** * Get the ConnectionPoint class as NamedNode. - * + * * @readonly */ get ConnectionPointNamedNode(): NamedNode { @@ -1268,7 +1321,7 @@ class BlueprintOntology extends Ontology { /** * Get the CompositionLinkResult class. - * + * * @readonly */ get CompositionLinkResult(): string { @@ -1277,7 +1330,7 @@ class BlueprintOntology extends Ontology { /** * Get the prefixed CompositionLinkResult class. - * + * * @readonly */ get CompositionLinkResultPrefixed(): string { @@ -1286,7 +1339,7 @@ class BlueprintOntology extends Ontology { /** * Get the CompositionLinkResult class as NamedNode. - * + * * @readonly */ get CompositionLinkResultNamedNode(): NamedNode { diff --git a/projects/blueprint/src/app/core/ontology/ontology.ts b/projects/blueprint/src/app/core/ontology/ontology.ts index 4ea5444..164055d 100644 --- a/projects/blueprint/src/app/core/ontology/ontology.ts +++ b/projects/blueprint/src/app/core/ontology/ontology.ts @@ -1,9 +1,9 @@ import { NamespaceBuilder } from '@rdfjs/namespace'; -export abstract class Ontology { - protected readonly _namespace: NamespaceBuilder; +export abstract class Ontology { + protected readonly _namespace: NamespaceBuilder; - constructor(namespace: NamespaceBuilder) { + constructor(namespace: NamespaceBuilder) { this._namespace = namespace; } From e3c52d316e951e783532bc9a06b84cee9dbd4c66 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Mon, 18 Nov 2024 10:48:27 +0100 Subject: [PATCH 2/4] refactor: make search dialect optional --- .changeset/three-lamps-sneeze.md | 5 ++++ .../app/core/service/config/config.service.ts | 2 +- .../library-configuration.model.ts | 4 +-- .../library-configuration.service.ts | 28 ++++++------------- .../app/core/service/sparql/sparql.service.ts | 11 ++------ 5 files changed, 20 insertions(+), 30 deletions(-) create mode 100644 .changeset/three-lamps-sneeze.md diff --git a/.changeset/three-lamps-sneeze.md b/.changeset/three-lamps-sneeze.md new file mode 100644 index 0000000..2bb5874 --- /dev/null +++ b/.changeset/three-lamps-sneeze.md @@ -0,0 +1,5 @@ +--- +"blueprint": patch +--- + +`fullTextSearchDialect` is not mandatory any more - REGEX implementation will be used diff --git a/projects/blueprint/src/app/core/service/config/config.service.ts b/projects/blueprint/src/app/core/service/config/config.service.ts index 3234551..8393835 100644 --- a/projects/blueprint/src/app/core/service/config/config.service.ts +++ b/projects/blueprint/src/app/core/service/config/config.service.ts @@ -31,7 +31,7 @@ export class ConfigService { environment.sparqlConsoleUrl = config?.sparqlConsoleUrl ?? null; environment.graphExplorerUrl = config?.graphExplorerUrl ?? null; - environment.fullTextSearchDialect = config?.fullTextSearchDialect ?? FullTextSearchDialect.STARDOG; + environment.fullTextSearchDialect = config?.fullTextSearchDialect; console.log('ConfigService', config?.fullTextSearchDialect); this._libraryConfigurationService.endpointUrl = environment.endpointUrl; diff --git a/projects/blueprint/src/app/core/service/library-configuration/library-configuration.model.ts b/projects/blueprint/src/app/core/service/library-configuration/library-configuration.model.ts index 4ce6e41..fcbc799 100644 --- a/projects/blueprint/src/app/core/service/library-configuration/library-configuration.model.ts +++ b/projects/blueprint/src/app/core/service/library-configuration/library-configuration.model.ts @@ -5,5 +5,5 @@ export interface LibraryConfiguration { endpointUrl: string, sparqlConsoleUrl: null | string, graphExplorerUrl: null | string, - fullTextSearchDialect: FullTextSearchDialect -} \ No newline at end of file + fullTextSearchDialect?: FullTextSearchDialect +} diff --git a/projects/blueprint/src/app/core/service/library-configuration/library-configuration.service.ts b/projects/blueprint/src/app/core/service/library-configuration/library-configuration.service.ts index 5378f93..cd3b7c8 100644 --- a/projects/blueprint/src/app/core/service/library-configuration/library-configuration.service.ts +++ b/projects/blueprint/src/app/core/service/library-configuration/library-configuration.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { LibraryConfiguration } from './library-configuration.model'; -import { FullTextSearchDialect } from '../sparql/sparql.service'; +import {Dialects, FullTextSearchDialect} from '../sparql/sparql.service'; @Injectable({ providedIn: 'root' @@ -14,30 +14,20 @@ export class LibraryConfigurationService { sparqlConsoleUrl: null, graphExplorerUrl: null, endpointUrl: 'http://localhost:4200/query', - fullTextSearchDialect: FullTextSearchDialect.STARDOG } } - get fullTextSearchDialect(): FullTextSearchDialect { + get fullTextSearchDialect(): FullTextSearchDialect | undefined { return this.configuration.fullTextSearchDialect; } - set fullTextSearchDialect(value: FullTextSearchDialect) { - switch (value) { - case 'fuseki': - this.configuration.fullTextSearchDialect = FullTextSearchDialect.FUSEKI; - break; - case 'stardog': - this.configuration.fullTextSearchDialect = FullTextSearchDialect.STARDOG; - break; - case 'neptune': - this.configuration.fullTextSearchDialect = FullTextSearchDialect.NEPTUNE; - break; - case 'graphdb': - this.configuration.fullTextSearchDialect = FullTextSearchDialect.GRAPHDB; - break; - default: - throw new Error('Invalid fullTextSearchDialect'); + set fullTextSearchDialect(value: FullTextSearchDialect | undefined) { + if(!value) { + this.configuration.fullTextSearchDialect = undefined + } else if(Dialects.includes(value)) { + this.configuration.fullTextSearchDialect = value; + } else { + throw new Error('Invalid fullTextSearchDialect'); } } diff --git a/projects/blueprint/src/app/core/service/sparql/sparql.service.ts b/projects/blueprint/src/app/core/service/sparql/sparql.service.ts index 2201550..bcd7a5d 100644 --- a/projects/blueprint/src/app/core/service/sparql/sparql.service.ts +++ b/projects/blueprint/src/app/core/service/sparql/sparql.service.ts @@ -20,7 +20,7 @@ export class SparqlService { private readonly http = inject(HttpClient); private readonly libraryConfigurationService = inject(LibraryConfigurationService); - public fullTextSearchDialect: FullTextSearchDialect; + public fullTextSearchDialect: FullTextSearchDialect | undefined; constructor() { this.fullTextSearchDialect = this.libraryConfigurationService.fullTextSearchDialect; @@ -90,10 +90,5 @@ export class SparqlService { } } - -export enum FullTextSearchDialect { - FUSEKI = 'fuseki', - STARDOG = 'stardog', - NEPTUNE = 'neptune', - GRAPHDB = 'graphdb' -} +export const Dialects = ['fuseki', 'stardog' ,'neptune' , 'graphdb'] as const; +export type FullTextSearchDialect = typeof Dialects[number]; From a2d456b1aa362b14d1d0008d097fe0be2da78c91 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Mon, 18 Nov 2024 10:48:55 +0100 Subject: [PATCH 3/4] feat: REGEX search dialect --- .changeset/six-ladybugs-matter.md | 5 + package-lock.json | 71 +++++++++++ package.json | 1 + .../regex-search/regex-search.class.ts | 111 ++++++++++++++++++ .../full-text-search/search-functions.ts | 39 ++++++ .../search/services/search/search.service.ts | 16 ++- 6 files changed, 237 insertions(+), 6 deletions(-) create mode 100644 .changeset/six-ladybugs-matter.md create mode 100644 projects/blueprint/src/app/features/search/services/search/full-text-search/regex-search/regex-search.class.ts create mode 100644 projects/blueprint/src/app/features/search/services/search/full-text-search/search-functions.ts diff --git a/.changeset/six-ladybugs-matter.md b/.changeset/six-ladybugs-matter.md new file mode 100644 index 0000000..9e2ca0f --- /dev/null +++ b/.changeset/six-ladybugs-matter.md @@ -0,0 +1,5 @@ +--- +"blueprint": minor +--- + +Added REGEX search dialect diff --git a/package-lock.json b/package-lock.json index b5e2f1a..24e95df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "@angular/service-worker": "^18.2.11", "@fortawesome/fontawesome-free": "^6.5.2", "@rdfjs/formats": "^4.0.0", + "@tpluscode/sparql-builder": "^3.0.1", "@zazuko/env": "2.2.0", "clownface-shacl-path": "^2.1.0", "d3": "^7.9.0", @@ -5371,6 +5372,22 @@ "@zazuko/prefixes": ">=1" } }, + "node_modules/@tpluscode/sparql-builder": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@tpluscode/sparql-builder/-/sparql-builder-3.0.1.tgz", + "integrity": "sha512-edBrrB9z5NM1bqrc2U7rPO1KbkOO+q+MqUZP6d8pC8BtSdHfSniG+ypkKilpM7guAJtHTma0H5nq+qpobhfNng==", + "license": "MIT", + "dependencies": { + "@rdfjs/data-model": "^2", + "@rdfjs/term-set": "^2", + "@rdfjs/types": "*", + "@tpluscode/rdf-string": "^1.3.0", + "@types/sparql-http-client": "^3.0.0" + }, + "peerDependencies": { + "sparql-http-client": "^3.0.0" + } + }, "node_modules/@tufjs/canonical-json": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz", @@ -6034,6 +6051,16 @@ "@types/node": "*" } }, + "node_modules/@types/sparql-http-client": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/sparql-http-client/-/sparql-http-client-3.0.4.tgz", + "integrity": "sha512-FTsBWUY1XJKn8K5VQi5dfWTW+xG4aNDci9s6Y1RGl5Y300F4FH/35qQeEQo+K3aD1G/eV1FDrZa2p0UNR10GOA==", + "license": "MIT", + "dependencies": { + "@rdfjs/types": ">=1.0.0", + "@types/rdfjs__environment": "*" + } + }, "node_modules/@types/sparqljs": { "version": "3.1.11", "resolved": "https://registry.npmjs.org/@types/sparqljs/-/sparqljs-3.1.11.tgz", @@ -15783,6 +15810,19 @@ "dev": true, "license": "MIT" }, + "node_modules/nodeify-fetch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/nodeify-fetch/-/nodeify-fetch-3.1.0.tgz", + "integrity": "sha512-ZV81vM//sEgTgXwVZlOONzcOCdTGQ53mV65FVSNXgPQHa8oCwRLtLbnGxL/1S/Yw90bcXUDKMz00jEnaeazo+A==", + "license": "MIT", + "peer": true, + "dependencies": { + "lodash": "^4.17.21", + "node-fetch": "^3.2.10", + "readable-stream": "^4.2.0", + "stream-chunks": "^1.0.0" + } + }, "node_modules/non-layered-tidy-tree-layout": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/non-layered-tidy-tree-layout/-/non-layered-tidy-tree-layout-2.0.2.tgz", @@ -17279,6 +17319,17 @@ "lodash": "^4.17.21" } }, + "node_modules/rdf-transform-triple-to-quad": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/rdf-transform-triple-to-quad/-/rdf-transform-triple-to-quad-2.0.1.tgz", + "integrity": "sha512-OknvjzZSwstm120ugeeXpzS8o8jZNK+qc9lNmKOtndc7t2J17i62h3BVccUh4M0dBZk/sKhgaXaALaEHbPuWPg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@rdfjs/data-model": "^2.0.2", + "readable-stream": "^4.5.2" + } + }, "node_modules/rdfxml-streaming-parser": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/rdfxml-streaming-parser/-/rdfxml-streaming-parser-2.4.0.tgz", @@ -18486,6 +18537,26 @@ "node": ">=0.10.0" } }, + "node_modules/sparql-http-client": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/sparql-http-client/-/sparql-http-client-3.0.1.tgz", + "integrity": "sha512-efsgs0Dq6SvQ3Ag4l5GhayTINN3zNlKo99WoA1SYS7iJ1T1tSJjM9ZadTJYK5T6LJayrLllPCILI5fkpn7tY7Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "@bergos/jsonparse": "^1.4.1", + "@rdfjs/data-model": "^2.0.2", + "@rdfjs/dataset": "^2.0.2", + "@rdfjs/environment": "^1.0.0", + "@rdfjs/parser-n3": "^2.0.2", + "@rdfjs/to-ntriples": "^3.0.1", + "duplex-to": "^2.0.0", + "nodeify-fetch": "^3.1.0", + "rdf-transform-triple-to-quad": "^2.0.0", + "readable-stream": "^4.5.2", + "stream-chunks": "^1.0.0" + } + }, "node_modules/sparqljs": { "version": "3.7.3", "resolved": "https://registry.npmjs.org/sparqljs/-/sparqljs-3.7.3.tgz", diff --git a/package.json b/package.json index 4ad5d9d..758b8de 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@angular/service-worker": "^18.2.11", "@fortawesome/fontawesome-free": "^6.5.2", "@rdfjs/formats": "^4.0.0", + "@tpluscode/sparql-builder": "^3.0.1", "@zazuko/env": "2.2.0", "clownface-shacl-path": "^2.1.0", "d3": "^7.9.0", diff --git a/projects/blueprint/src/app/features/search/services/search/full-text-search/regex-search/regex-search.class.ts b/projects/blueprint/src/app/features/search/services/search/full-text-search/regex-search/regex-search.class.ts new file mode 100644 index 0000000..d5f6ce4 --- /dev/null +++ b/projects/blueprint/src/app/features/search/services/search/full-text-search/regex-search/regex-search.class.ts @@ -0,0 +1,111 @@ +import {UiClassMetadata} from "@blueprint/model/ui-class-metadata/ui-class-metadata"; +import {FullTextSearch} from "../../util/abstract-search.class"; +import {CONSTRUCT, SELECT, sparql, SparqlTemplateResult} from "@tpluscode/sparql-builder"; +import {blueprint} from "@blueprint/ontology"; +import {classQueries, classSparqlBlock} from "../search-functions"; +import env from "@zazuko/env"; +import {UNION} from "@tpluscode/sparql-builder/expressions"; + +const rdfs = env.ns.rdfs + +export class RegexSearch extends FullTextSearch { + override searchQueryWithSearchTerm(metadata: UiClassMetadata[], pageNumber: number, pageSize: number): string { + const subQueries = classQueries(metadata) + const searchTerm = this._searchContext.searchTerm.toString() + + const query = CONSTRUCT` + ${blueprint.namespace.query} a ${blueprint.namespace.UiSearchResult} ; + ${blueprint.namespace.result} ?sub ; + ${blueprint.namespace.pageSize} ${pageSize}; + ${blueprint.namespace.pageNumber} ${pageNumber}; + . + + ?sub a ?fluxIri ; + a ${blueprint.namespace.UiSearchResult} ; + ${blueprint.namespace.score} 1 ; + ${rdfs.label} ?label ; + ${rdfs.comment} ?comment ; + . + `.WHERE` + ${SELECT.ALL.WHERE` + ${SELECT`?sub`.WHERE` + ${this.fullTextSearchQuery(searchTerm)} + `} + + ${subQueries} + + `.OFFSET(pageNumber * pageSize).LIMIT(pageSize)} + ` + + return query.build() + } + + override classCountQueryWithSearchTerm(metadata: UiClassMetadata[]): string { + const searchTerm = this._searchContext.searchTerm.toString() + + const fluxIri = env.variable('fluxIri') + const subQueries = metadata.map((meta) => + classSparqlBlock(fluxIri, meta.targetNode, this.fullTextSearchQuery(searchTerm))); + + const construct = CONSTRUCT` + ${fluxIri} a ${blueprint.namespace.UiClassCount} ; + ${blueprint.namespace.count} ?count . + `.WHERE` + ${UNION(...subQueries)} + ` + + return construct.build() + } + + override totalCountQueryWithSearchTerm(metadata: UiClassMetadata[]): string { + let construct = CONSTRUCT` + ${blueprint.namespace.query} a ${blueprint.namespace.UiSearchResult} ; + ${blueprint.namespace.total} ?count . + ` + + const subQueries = classQueries(metadata) + + const searchTerm = this._searchContext.searchTerm.toString() + if (!searchTerm?.length) { + construct = construct.WHERE` + SELECT (count( DISTINCT ?sub) as ?count) WHERE { + ${subQueries} + BIND ((${env.ns.xsd.float}(?searchPriority)) AS ?score) + } + ` + } else { + const countSelect = SELECT`(count(DISTINCT ?sub) as ?count)` + .WHERE` + ${this.fullTextSearchQuery(searchTerm)} + `.GROUP().BY('sub') + + construct = construct.WHERE` + { + { ${countSelect} } + + ${subQueries} + } + ` + } + + return construct.build() + } + + protected fullTextSearchQuery(input: string): SparqlTemplateResult | '' { + if (!input || input.length === 0) { + return ''; + } + + return sparql` + ?sub ?p ?text . + { + ?p rdfs:subPropertyOf* ${rdfs.label} . + } + UNION + { + ?p rdfs:subPropertyOf* ${rdfs.comment} . + } + FILTER regex(?text, "${input}", "i") . + ` + } +} diff --git a/projects/blueprint/src/app/features/search/services/search/full-text-search/search-functions.ts b/projects/blueprint/src/app/features/search/services/search/full-text-search/search-functions.ts new file mode 100644 index 0000000..2812f3c --- /dev/null +++ b/projects/blueprint/src/app/features/search/services/search/full-text-search/search-functions.ts @@ -0,0 +1,39 @@ +import {UiClassMetadata} from "@blueprint/model/ui-class-metadata/ui-class-metadata"; +import env from "@zazuko/env"; +import {SELECT, sparql, SparqlTemplateResult} from "@tpluscode/sparql-builder"; +import {UNION} from "@tpluscode/sparql-builder/expressions"; +import {Term, Variable} from "@rdfjs/types"; + +const {rdfs} = env.ns + +export function classQueries(metadata: UiClassMetadata[]) { + return UNION(...metadata.map(classSubQuery)); +} + +function classSubQuery(classMetadata: UiClassMetadata) { + return sparql` + { + BIND( ${classMetadata.targetNode} as ?fluxIri) + BIND( ${classMetadata.searchPriority} as ?searchPriority) + + ?sub a ?fluxIri . + ?sub ?l ?label . + ?l ${rdfs.subPropertyOf}* ${rdfs.label} . + OPTIONAL { + ?sub ?c ?comment . + ?c ${rdfs.subPropertyOf}* ${rdfs.comment} . + } + }`; +} + +export function classSparqlBlock(fluxIri: Variable, iri: Term, fullTextSearchBlock: SparqlTemplateResult | '') { + return SELECT`${fluxIri} (COUNT(DISTINCT ?sub) AS ?count)` + .WHERE` + VALUES ${fluxIri} + { + ${iri} + } + ?sub a ${iri} . + ${fullTextSearchBlock} + `.GROUP().BY(fluxIri) +} diff --git a/projects/blueprint/src/app/features/search/services/search/search.service.ts b/projects/blueprint/src/app/features/search/services/search/search.service.ts index 2bc9b68..91a3453 100644 --- a/projects/blueprint/src/app/features/search/services/search/search.service.ts +++ b/projects/blueprint/src/app/features/search/services/search/search.service.ts @@ -14,9 +14,10 @@ import { StardogFullTextSearch } from './full-text-search/stardog-full-text-sear import { FusekiFullTextSearch } from './full-text-search/fuseki-full-text-search/fuseki-full-text-search.class'; import { NeptuneFullTextSearch } from './full-text-search/neptune-full-text-search/neptune-full-text-search.class'; import { GraphDBFullTextSearch } from './full-text-search/graphdb-full-text-search/graphdb-full-text-search.class'; +import { RegexSearch } from "./full-text-search/regex-search/regex-search.class"; import { blueprint, rdf } from '@blueprint/ontology'; -import { FullTextSearchDialect, SparqlService } from '@blueprint/service/sparql/sparql.service'; +import { SparqlService } from '@blueprint/service/sparql/sparql.service'; import { sparqlUtils } from '@blueprint/utils'; import { UiClassMetadataService } from '@blueprint/service/ui-class-metadata/ui-class-metadata.service'; import { SearchResultItem } from '@blueprint/model/search-result-item/search-result-item'; @@ -94,7 +95,7 @@ export class SearchService { /** * Fetch a new page for this search - * + * * @param pageNumber new page to fetch * @returns Observable with the dataset containing the new results */ @@ -112,18 +113,21 @@ export class SearchService { let ftsProvider: FusekiFullTextSearch | StardogFullTextSearch | NeptuneFullTextSearch | GraphDBFullTextSearch; switch (this.sparqlService.fullTextSearchDialect) { - case FullTextSearchDialect.FUSEKI: + case 'fuseki': ftsProvider = new FusekiFullTextSearch(this.searchContext); break; - case FullTextSearchDialect.NEPTUNE: + case 'neptune': ftsProvider = new NeptuneFullTextSearch(this.searchContext); break; - case FullTextSearchDialect.GRAPHDB: + case 'graphdb': ftsProvider = new GraphDBFullTextSearch(this.searchContext); break; - default: + case 'stardog': ftsProvider = new StardogFullTextSearch(this.searchContext); break; + default: + ftsProvider = new RegexSearch(this.searchContext); + break; } // log what kind of ftsProvider is used From 3e96cf0e422b364784e4029004393a946a43d978 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Mon, 18 Nov 2024 12:33:07 +0100 Subject: [PATCH 4/4] revert: "manual label inferencing" --- .../full-text-search/regex-search/regex-search.class.ts | 4 ++-- .../services/search/full-text-search/search-functions.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/blueprint/src/app/features/search/services/search/full-text-search/regex-search/regex-search.class.ts b/projects/blueprint/src/app/features/search/services/search/full-text-search/regex-search/regex-search.class.ts index d5f6ce4..47ab14b 100644 --- a/projects/blueprint/src/app/features/search/services/search/full-text-search/regex-search/regex-search.class.ts +++ b/projects/blueprint/src/app/features/search/services/search/full-text-search/regex-search/regex-search.class.ts @@ -99,11 +99,11 @@ export class RegexSearch extends FullTextSearch { return sparql` ?sub ?p ?text . { - ?p rdfs:subPropertyOf* ${rdfs.label} . + ?p rdfs:subPropertyOf ${rdfs.label} . } UNION { - ?p rdfs:subPropertyOf* ${rdfs.comment} . + ?p rdfs:subPropertyOf ${rdfs.comment} . } FILTER regex(?text, "${input}", "i") . ` diff --git a/projects/blueprint/src/app/features/search/services/search/full-text-search/search-functions.ts b/projects/blueprint/src/app/features/search/services/search/full-text-search/search-functions.ts index 2812f3c..a70ee18 100644 --- a/projects/blueprint/src/app/features/search/services/search/full-text-search/search-functions.ts +++ b/projects/blueprint/src/app/features/search/services/search/full-text-search/search-functions.ts @@ -18,10 +18,10 @@ function classSubQuery(classMetadata: UiClassMetadata) { ?sub a ?fluxIri . ?sub ?l ?label . - ?l ${rdfs.subPropertyOf}* ${rdfs.label} . + ?l ${rdfs.subPropertyOf} ${rdfs.label} . OPTIONAL { ?sub ?c ?comment . - ?c ${rdfs.subPropertyOf}* ${rdfs.comment} . + ?c ${rdfs.subPropertyOf} ${rdfs.comment} . } }`; }