From 759a0cc0dfc7f93da347d21b955d797ca8fbcd08 Mon Sep 17 00:00:00 2001 From: Dave Cockrell Date: Tue, 16 Apr 2024 17:50:17 +0100 Subject: [PATCH] fix: add prefixes Prefixes now reload the rdf. A quad array is used to generate nodes rdf --- .eslintcache | 2 +- src/lib/CustomNode/ClassInstanceNode.tsx | 2 +- src/rdfInstanceViewer/RdfInstancePresenter.ts | 21 ++++++++++++++++--- .../RdfInstanceRepository.ts | 9 +++----- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.eslintcache b/.eslintcache index f055b3b..f0b6734 100644 --- a/.eslintcache +++ b/.eslintcache @@ -1 +1 @@ -[{"/Users/dave/Documents/OSS/telicent-instance/src/App.tsx":"1","/Users/dave/Documents/OSS/telicent-instance/src/main.tsx":"2","/Users/dave/Documents/OSS/telicent-instance/src/vite-env.d.ts":"3","/Users/dave/Documents/OSS/telicent-instance/vite.config.ts":"4","/Users/dave/Documents/OSS/telicent-instance/src/Core/Providers/injection.tsx":"5","/Users/dave/Documents/OSS/telicent-instance/src/AppIOC.ts":"6","/Users/dave/Documents/OSS/telicent-instance/src/BaseIOC.ts":"7","/Users/dave/Documents/OSS/telicent-instance/src/Core/HttpGateway.ts":"8","/Users/dave/Documents/OSS/telicent-instance/src/Core/Types.ts":"9","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstancePresenter.ts":"10","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceRepository.ts":"11","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceViewer.tsx":"12","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/Types/index.ts":"13","/Users/dave/Documents/OSS/telicent-instance/src/Core/FakeHttpGateway.ts":"14","/Users/dave/Documents/OSS/telicent-instance/src/TestTools/AppTestHarness.ts":"15","/Users/dave/Documents/OSS/telicent-instance/src/TestTools/GetHierarchyStub.ts":"16","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceViewer.test.ts":"17","/Users/dave/Documents/OSS/telicent-instance/src/Components/Diagram/Diagram.tsx":"18","/Users/dave/Documents/OSS/telicent-instance/src/Components/ResizableDivs/ResizableDivider.tsx":"19","/Users/dave/Documents/OSS/telicent-instance/src/Components/ResizableDivs/ResizableDivs.tsx":"20","/Users/dave/Documents/OSS/telicent-instance/src/Components/Terminal/Terminal.tsx":"21","/Users/dave/Documents/OSS/telicent-instance/src/helpers/index.ts":"22","/Users/dave/Documents/OSS/telicent-instance/src/constants/index.ts":"23","/Users/dave/Documents/OSS/telicent-instance/src/models/rdf.ts":"24","/Users/dave/Documents/OSS/telicent-instance/src/lib/CustomNode/CustomNode.tsx":"25","/Users/dave/Documents/OSS/telicent-instance/src/types/index.ts":"26"},{"size":410,"mtime":1712842737178,"results":"27","hashOfConfig":"28"},{"size":423,"mtime":1711545896952,"results":"29","hashOfConfig":"28"},{"size":38,"mtime":1711132217284,"results":"30","hashOfConfig":"31"},{"size":219,"mtime":1711209275242,"results":"32","hashOfConfig":"28"},{"size":1398,"mtime":1712948557348,"results":"33","hashOfConfig":"28"},{"size":255,"mtime":1711390418152,"results":"34","hashOfConfig":"28"},{"size":454,"mtime":1711449678819,"results":"35","hashOfConfig":"28"},{"size":935,"mtime":1712950109581,"results":"36","hashOfConfig":"28"},{"size":111,"mtime":1711390451727,"results":"37","hashOfConfig":"28"},{"size":3854,"mtime":1713191796682,"results":"38","hashOfConfig":"28"},{"size":4487,"mtime":1712955901411,"results":"39","hashOfConfig":"28"},{"size":1070,"mtime":1713188698996,"results":"40","hashOfConfig":"28"},{"size":781,"mtime":1711447185794,"results":"41","hashOfConfig":"28"},{"size":759,"mtime":1711466940303,"results":"42","hashOfConfig":"28"},{"size":415,"mtime":1711461140452,"results":"43","hashOfConfig":"28"},{"size":515911,"mtime":1711468176513,"results":"44","hashOfConfig":"28"},{"size":1329,"mtime":1711472412695,"results":"45","hashOfConfig":"28"},{"size":1750,"mtime":1713192247030,"results":"46","hashOfConfig":"28"},{"size":367,"mtime":1712948557346,"results":"47","hashOfConfig":"28"},{"size":1913,"mtime":1712842737181,"results":"48","hashOfConfig":"28"},{"size":4875,"mtime":1713192123255,"results":"49","hashOfConfig":"28"},{"size":658,"mtime":1712842737183,"results":"50","hashOfConfig":"28"},{"size":283,"mtime":1712948557348,"results":"51","hashOfConfig":"28"},{"size":1120,"mtime":1712948557350,"results":"52","hashOfConfig":"28"},{"size":297,"mtime":1713188495075,"results":"53","hashOfConfig":"28"},{"size":148,"mtime":1713188485314,"results":"54","hashOfConfig":"28"},{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"cwmttc",{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1c56v47",{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","suppressedMessages":"69","errorCount":0,"fatalErrorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"70","messages":"71","suppressedMessages":"72","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","suppressedMessages":"75","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"76","messages":"77","suppressedMessages":"78","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","suppressedMessages":"81","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"82","messages":"83","suppressedMessages":"84","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","suppressedMessages":"87","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"88","messages":"89","suppressedMessages":"90","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"91","messages":"92","suppressedMessages":"93","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","suppressedMessages":"96","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"97","messages":"98","suppressedMessages":"99","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","suppressedMessages":"102","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"103","messages":"104","suppressedMessages":"105","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","suppressedMessages":"108","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"109","messages":"110","suppressedMessages":"111","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","suppressedMessages":"114","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"115","messages":"116","suppressedMessages":"117","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","suppressedMessages":"120","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"121","messages":"122","suppressedMessages":"123","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","suppressedMessages":"126","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"127","messages":"128","suppressedMessages":"129","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","suppressedMessages":"132","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/dave/Documents/OSS/telicent-instance/src/App.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/main.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/vite-env.d.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/vite.config.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Core/Providers/injection.tsx",["133","134","135","136","137"],[],"/Users/dave/Documents/OSS/telicent-instance/src/AppIOC.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/BaseIOC.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Core/HttpGateway.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Core/Types.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstancePresenter.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceRepository.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceViewer.tsx",["138"],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/Types/index.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Core/FakeHttpGateway.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/TestTools/AppTestHarness.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/TestTools/GetHierarchyStub.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceViewer.test.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Components/Diagram/Diagram.tsx",["139","140"],[],"/Users/dave/Documents/OSS/telicent-instance/src/Components/ResizableDivs/ResizableDivider.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Components/ResizableDivs/ResizableDivs.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Components/Terminal/Terminal.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/helpers/index.ts",["141","142"],[],"/Users/dave/Documents/OSS/telicent-instance/src/constants/index.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/models/rdf.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/lib/CustomNode/CustomNode.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/types/index.ts",[],[],{"ruleId":"143","severity":1,"message":"144","line":4,"column":71,"nodeType":"145","messageId":"146","endLine":4,"endColumn":74,"suggestions":"147"},{"ruleId":"148","severity":1,"message":"149","line":24,"column":14,"nodeType":"150","messageId":"151","endLine":24,"endColumn":26},{"ruleId":"148","severity":1,"message":"149","line":33,"column":14,"nodeType":"150","messageId":"151","endLine":33,"endColumn":27},{"ruleId":"143","severity":1,"message":"144","line":34,"column":42,"nodeType":"145","messageId":"146","endLine":34,"endColumn":45,"suggestions":"152"},{"ruleId":"143","severity":1,"message":"144","line":41,"column":40,"nodeType":"145","messageId":"146","endLine":41,"endColumn":43,"suggestions":"153"},{"ruleId":"154","severity":1,"message":"155","line":17,"column":6,"nodeType":"156","endLine":17,"endColumn":8,"suggestions":"157"},{"ruleId":"154","severity":1,"message":"155","line":28,"column":6,"nodeType":"156","endLine":28,"endColumn":8,"suggestions":"158"},{"ruleId":"154","severity":1,"message":"159","line":32,"column":6,"nodeType":"156","endLine":32,"endColumn":39,"suggestions":"160"},{"ruleId":"143","severity":1,"message":"144","line":9,"column":78,"nodeType":"145","messageId":"146","endLine":9,"endColumn":81,"suggestions":"161"},{"ruleId":"143","severity":1,"message":"144","line":9,"column":83,"nodeType":"145","messageId":"146","endLine":9,"endColumn":86,"suggestions":"162"},"@typescript-eslint/no-explicit-any","Unexpected any. Specify a different type.","TSAnyKeyword","unexpectedAny",["163","164"],"react-refresh/only-export-components","Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components.","Identifier","namedExport",["165","166"],["167","168"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'props.presenter'. Either include it or remove the dependency array.","ArrayExpression",["169"],["170"],"React Hook useEffect has a missing dependency: 'setNodes'. Either include it or remove the dependency array.",["171"],["172","173"],["174","175"],{"messageId":"176","fix":"177","desc":"178"},{"messageId":"179","fix":"180","desc":"181"},{"messageId":"176","fix":"182","desc":"178"},{"messageId":"179","fix":"183","desc":"181"},{"messageId":"176","fix":"184","desc":"178"},{"messageId":"179","fix":"185","desc":"181"},{"desc":"186","fix":"187"},{"desc":"186","fix":"188"},{"desc":"189","fix":"190"},{"messageId":"176","fix":"191","desc":"178"},{"messageId":"179","fix":"192","desc":"181"},{"messageId":"176","fix":"193","desc":"178"},{"messageId":"179","fix":"194","desc":"181"},"suggestUnknown",{"range":"195","text":"196"},"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.","suggestNever",{"range":"197","text":"198"},"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",{"range":"199","text":"196"},{"range":"200","text":"198"},{"range":"201","text":"196"},{"range":"202","text":"198"},"Update the dependencies array to be: [props.presenter]",{"range":"203","text":"204"},{"range":"205","text":"204"},"Update the dependencies array to be: [props.presenter.viewModel.nodes, setNodes]",{"range":"206","text":"207"},{"range":"208","text":"196"},{"range":"209","text":"198"},{"range":"210","text":"196"},{"range":"211","text":"198"},[163,166],"unknown",[163,166],"never",[952,955],[952,955],[1180,1183],[1180,1183],[659,661],"[props.presenter]",[989,991],[1065,1098],"[props.presenter.viewModel.nodes, setNodes]",[381,384],[381,384],[386,389],[386,389]] \ No newline at end of file +[{"/Users/dave/Documents/OSS/telicent-instance/src/App.tsx":"1","/Users/dave/Documents/OSS/telicent-instance/src/main.tsx":"2","/Users/dave/Documents/OSS/telicent-instance/src/vite-env.d.ts":"3","/Users/dave/Documents/OSS/telicent-instance/vite.config.ts":"4","/Users/dave/Documents/OSS/telicent-instance/src/Core/Providers/injection.tsx":"5","/Users/dave/Documents/OSS/telicent-instance/src/AppIOC.ts":"6","/Users/dave/Documents/OSS/telicent-instance/src/BaseIOC.ts":"7","/Users/dave/Documents/OSS/telicent-instance/src/Core/HttpGateway.ts":"8","/Users/dave/Documents/OSS/telicent-instance/src/Core/Types.ts":"9","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstancePresenter.ts":"10","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceRepository.ts":"11","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceViewer.tsx":"12","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/Types/index.ts":"13","/Users/dave/Documents/OSS/telicent-instance/src/Core/FakeHttpGateway.ts":"14","/Users/dave/Documents/OSS/telicent-instance/src/TestTools/AppTestHarness.ts":"15","/Users/dave/Documents/OSS/telicent-instance/src/TestTools/GetHierarchyStub.ts":"16","/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceViewer.test.ts":"17","/Users/dave/Documents/OSS/telicent-instance/src/Components/Diagram/Diagram.tsx":"18","/Users/dave/Documents/OSS/telicent-instance/src/Components/ResizableDivs/ResizableDivider.tsx":"19","/Users/dave/Documents/OSS/telicent-instance/src/Components/ResizableDivs/ResizableDivs.tsx":"20","/Users/dave/Documents/OSS/telicent-instance/src/Components/Terminal/Terminal.tsx":"21","/Users/dave/Documents/OSS/telicent-instance/src/helpers/index.ts":"22","/Users/dave/Documents/OSS/telicent-instance/src/constants/index.ts":"23","/Users/dave/Documents/OSS/telicent-instance/src/models/rdf.ts":"24","/Users/dave/Documents/OSS/telicent-instance/src/types/index.ts":"25","/Users/dave/Documents/OSS/telicent-instance/src/lib/CustomNode/ClassInstanceNode.tsx":"26"},{"size":410,"mtime":1712842737178,"results":"27","hashOfConfig":"28"},{"size":423,"mtime":1711545896952,"results":"29","hashOfConfig":"28"},{"size":38,"mtime":1711132217284,"results":"30","hashOfConfig":"31"},{"size":219,"mtime":1711209275242,"results":"32","hashOfConfig":"28"},{"size":1398,"mtime":1712948557348,"results":"33","hashOfConfig":"28"},{"size":255,"mtime":1711390418152,"results":"34","hashOfConfig":"28"},{"size":454,"mtime":1711449678819,"results":"35","hashOfConfig":"28"},{"size":935,"mtime":1712950109581,"results":"36","hashOfConfig":"28"},{"size":111,"mtime":1711390451727,"results":"37","hashOfConfig":"28"},{"size":4500,"mtime":1713277183088,"results":"38","hashOfConfig":"28"},{"size":5194,"mtime":1713276909589,"results":"39","hashOfConfig":"28"},{"size":1070,"mtime":1713188698996,"results":"40","hashOfConfig":"28"},{"size":781,"mtime":1711447185794,"results":"41","hashOfConfig":"28"},{"size":759,"mtime":1711466940303,"results":"42","hashOfConfig":"28"},{"size":415,"mtime":1711461140452,"results":"43","hashOfConfig":"28"},{"size":515911,"mtime":1711468176513,"results":"44","hashOfConfig":"28"},{"size":1329,"mtime":1711472412695,"results":"45","hashOfConfig":"28"},{"size":1828,"mtime":1713274884206,"results":"46","hashOfConfig":"28"},{"size":367,"mtime":1712948557346,"results":"47","hashOfConfig":"28"},{"size":1913,"mtime":1712842737181,"results":"48","hashOfConfig":"28"},{"size":4875,"mtime":1713192123255,"results":"49","hashOfConfig":"28"},{"size":658,"mtime":1712842737183,"results":"50","hashOfConfig":"28"},{"size":283,"mtime":1712948557348,"results":"51","hashOfConfig":"28"},{"size":1120,"mtime":1712948557350,"results":"52","hashOfConfig":"28"},{"size":148,"mtime":1713188485314,"results":"53","hashOfConfig":"28"},{"size":760,"mtime":1713261320158,"results":"54","hashOfConfig":"28"},{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"cwmttc",{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1c56v47",{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","suppressedMessages":"69","errorCount":0,"fatalErrorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"70","messages":"71","suppressedMessages":"72","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","suppressedMessages":"75","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"76","messages":"77","suppressedMessages":"78","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","suppressedMessages":"81","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"82","messages":"83","suppressedMessages":"84","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","suppressedMessages":"87","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"88","messages":"89","suppressedMessages":"90","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"91","messages":"92","suppressedMessages":"93","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","suppressedMessages":"96","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"97","messages":"98","suppressedMessages":"99","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","suppressedMessages":"102","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"103","messages":"104","suppressedMessages":"105","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","suppressedMessages":"108","errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"109","messages":"110","suppressedMessages":"111","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","suppressedMessages":"114","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"115","messages":"116","suppressedMessages":"117","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","suppressedMessages":"120","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"121","messages":"122","suppressedMessages":"123","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","suppressedMessages":"126","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"127","messages":"128","suppressedMessages":"129","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","suppressedMessages":"132","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/dave/Documents/OSS/telicent-instance/src/App.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/main.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/vite-env.d.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/vite.config.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Core/Providers/injection.tsx",["133","134","135","136","137"],[],"/Users/dave/Documents/OSS/telicent-instance/src/AppIOC.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/BaseIOC.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Core/HttpGateway.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Core/Types.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstancePresenter.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceRepository.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceViewer.tsx",["138"],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/Types/index.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Core/FakeHttpGateway.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/TestTools/AppTestHarness.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/TestTools/GetHierarchyStub.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/rdfInstanceViewer/RdfInstanceViewer.test.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Components/Diagram/Diagram.tsx",["139","140","141"],[],"/Users/dave/Documents/OSS/telicent-instance/src/Components/ResizableDivs/ResizableDivider.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Components/ResizableDivs/ResizableDivs.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/Components/Terminal/Terminal.tsx",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/helpers/index.ts",["142","143"],[],"/Users/dave/Documents/OSS/telicent-instance/src/constants/index.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/models/rdf.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/types/index.ts",[],[],"/Users/dave/Documents/OSS/telicent-instance/src/lib/CustomNode/ClassInstanceNode.tsx",[],[],{"ruleId":"144","severity":1,"message":"145","line":4,"column":71,"nodeType":"146","messageId":"147","endLine":4,"endColumn":74,"suggestions":"148"},{"ruleId":"149","severity":1,"message":"150","line":24,"column":14,"nodeType":"151","messageId":"152","endLine":24,"endColumn":26},{"ruleId":"149","severity":1,"message":"150","line":33,"column":14,"nodeType":"151","messageId":"152","endLine":33,"endColumn":27},{"ruleId":"144","severity":1,"message":"145","line":34,"column":42,"nodeType":"146","messageId":"147","endLine":34,"endColumn":45,"suggestions":"153"},{"ruleId":"144","severity":1,"message":"145","line":41,"column":40,"nodeType":"146","messageId":"147","endLine":41,"endColumn":43,"suggestions":"154"},{"ruleId":"155","severity":1,"message":"156","line":17,"column":6,"nodeType":"157","endLine":17,"endColumn":8,"suggestions":"158"},{"ruleId":"155","severity":1,"message":"156","line":25,"column":6,"nodeType":"157","endLine":25,"endColumn":8,"suggestions":"159"},{"ruleId":"155","severity":1,"message":"160","line":29,"column":6,"nodeType":"157","endLine":29,"endColumn":39,"suggestions":"161"},{"ruleId":"155","severity":1,"message":"162","line":37,"column":6,"nodeType":"157","endLine":37,"endColumn":16,"suggestions":"163"},{"ruleId":"144","severity":1,"message":"145","line":9,"column":78,"nodeType":"146","messageId":"147","endLine":9,"endColumn":81,"suggestions":"164"},{"ruleId":"144","severity":1,"message":"145","line":9,"column":83,"nodeType":"146","messageId":"147","endLine":9,"endColumn":86,"suggestions":"165"},"@typescript-eslint/no-explicit-any","Unexpected any. Specify a different type.","TSAnyKeyword","unexpectedAny",["166","167"],"react-refresh/only-export-components","Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components.","Identifier","namedExport",["168","169"],["170","171"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'props.presenter'. Either include it or remove the dependency array.","ArrayExpression",["172"],["173"],"React Hook useEffect has a missing dependency: 'setNodes'. Either include it or remove the dependency array.",["174"],"React Hook useCallback has a missing dependency: 'props.presenter.rdfInstanceRepository'. Either include it or remove the dependency array.",["175"],["176","177"],["178","179"],{"messageId":"180","fix":"181","desc":"182"},{"messageId":"183","fix":"184","desc":"185"},{"messageId":"180","fix":"186","desc":"182"},{"messageId":"183","fix":"187","desc":"185"},{"messageId":"180","fix":"188","desc":"182"},{"messageId":"183","fix":"189","desc":"185"},{"desc":"190","fix":"191"},{"desc":"190","fix":"192"},{"desc":"193","fix":"194"},{"desc":"195","fix":"196"},{"messageId":"180","fix":"197","desc":"182"},{"messageId":"183","fix":"198","desc":"185"},{"messageId":"180","fix":"199","desc":"182"},{"messageId":"183","fix":"200","desc":"185"},"suggestUnknown",{"range":"201","text":"202"},"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.","suggestNever",{"range":"203","text":"204"},"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",{"range":"205","text":"202"},{"range":"206","text":"204"},{"range":"207","text":"202"},{"range":"208","text":"204"},"Update the dependencies array to be: [props.presenter]",{"range":"209","text":"210"},{"range":"211","text":"210"},"Update the dependencies array to be: [props.presenter.viewModel.nodes, setNodes]",{"range":"212","text":"213"},"Update the dependencies array to be: [props.presenter.rdfInstanceRepository, setEdges]",{"range":"214","text":"215"},{"range":"216","text":"202"},{"range":"217","text":"204"},{"range":"218","text":"202"},{"range":"219","text":"204"},[163,166],"unknown",[163,166],"never",[952,955],[952,955],[1180,1183],[1180,1183],[659,661],"[props.presenter]",[936,938],[1012,1045],"[props.presenter.viewModel.nodes, setNodes]",[1319,1329],"[props.presenter.rdfInstanceRepository, setEdges]",[381,384],[381,384],[386,389],[386,389]] \ No newline at end of file diff --git a/src/lib/CustomNode/ClassInstanceNode.tsx b/src/lib/CustomNode/ClassInstanceNode.tsx index f99b8ad..89612fa 100644 --- a/src/lib/CustomNode/ClassInstanceNode.tsx +++ b/src/lib/CustomNode/ClassInstanceNode.tsx @@ -11,7 +11,7 @@ interface CustomNode extends Node { } const ClassInstanceNode: FC> = (node) => { - console.log({ node }) + // console.log({ node }) // TODO: work out how to update prefixes. If user removes // a prefix in the terminal it should be removed from // from the OntologyService diff --git a/src/rdfInstanceViewer/RdfInstancePresenter.ts b/src/rdfInstanceViewer/RdfInstancePresenter.ts index 89a0898..4dc0f1b 100644 --- a/src/rdfInstanceViewer/RdfInstancePresenter.ts +++ b/src/rdfInstanceViewer/RdfInstancePresenter.ts @@ -92,6 +92,7 @@ export class RdfInstancePresenter { if (!rdfInput) return // @ts-expect-error From does not exist on type Readable when it actually does const input = Readable.from([rdfInput]) + const quads: Array = [] const nodeQuads: Array = [] const edgeQuads: Array = [] const iesObjectQuads: Array = [] @@ -104,11 +105,13 @@ export class RdfInstancePresenter { const existingPrefixes = Object.keys(this.viewModel.prefixes) // Add prefix - if (!existingPrefixes.includes(prefix)) { - this.rdfInstanceRepository.addPrefix(prefix, namespace) + if (!existingPrefixes.includes(`${prefix}:`)) { + console.log({ prefix, namespace }) + this.rdfInstanceRepository.addPrefix(prefix, namespace.value) } - }).on("data", (triple) => { + console.log({ triple }) + quads.push(triple) // Set objects if (triple.object.termType === "Literal") { iesObjectQuads.push(triple); @@ -128,6 +131,18 @@ export class RdfInstancePresenter { this.rdfInstanceRepository.nodes = [...nodeQuads] this.rdfInstanceRepository.edges = [...edgeQuads] this.rdfInstanceRepository.iesObjects = [...iesObjectQuads] + this.rdfInstanceRepository.loadPrefixes() + console.log({ quads }) + + quads.forEach(quad => { + this.rdfInstanceRepository.rdf += `${this.rdfInstanceRepository.getUserFriendlyURI(quad.subject.value)} a ${this.rdfInstanceRepository.getUserFriendlyURI(quad.object.value)} .\n` + }); + + // @prefix data: . + // @prefix ies: . + // data:6cd17931-5c29-4cb9-8c26-745939aa9335 a ies:BoundingState . + // data:0b791546-4f5c-4d58-9b62-7b7608af6468 a ies:Person . + // }) }).on("error", (err: QuadError) => { console.log({ err }) diff --git a/src/rdfInstanceViewer/RdfInstanceRepository.ts b/src/rdfInstanceViewer/RdfInstanceRepository.ts index 6860655..b9fab13 100644 --- a/src/rdfInstanceViewer/RdfInstanceRepository.ts +++ b/src/rdfInstanceViewer/RdfInstanceRepository.ts @@ -80,7 +80,7 @@ export class RdfInstanceRepository { addEdgeToRdf = (source: string, target: string) => { const previous = this.rdf - this.rdf = `${previous}\n ${source} ${this.selectedRelationship} ${target} .` + this.rdf = `${previous}\n ${this.getUserFriendlyURI(source)} ${this.selectedRelationship} ${this.getUserFriendlyURI(target)} .` } async loadHierarchy() { @@ -152,16 +152,13 @@ export class RdfInstanceRepository { runInAction(() => { this.prefixes = prefixes - this.rdf = rdfPrefix + this.rdf = `${rdfPrefix}\n` }) } addPrefix(prefix: string, namespace: string) { + console.log({ prefix, namespace }) this.dataGateway.addPrefix(`${prefix}:`, namespace) - - runInAction(() => { - this.prefixes = this.dataGateway.getPrefixes() - }) } getUserFriendlyURI(s: string) {