solid-panes 3.7.3-1bd42721 → 3.7.3-322e9b27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Documentation/VisualLanguage.html +538 -0
- package/Documentation/conventions.md +333 -0
- package/coverage/clover.xml +152 -0
- package/coverage/coverage-final.json +6 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +131 -0
- package/coverage/lcov-report/outline/index.html +161 -0
- package/coverage/lcov-report/outline/outlineIcons.js.html +565 -0
- package/coverage/lcov-report/outline/propertyViews.ts.html +196 -0
- package/coverage/lcov-report/outline/viewAsImage.ts.html +121 -0
- package/coverage/lcov-report/outline/viewAsMbox.ts.html +127 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/trustedApplications/index.html +116 -0
- package/coverage/lcov-report/trustedApplications/trustedApplications.utils.ts.html +238 -0
- package/coverage/lcov.info +204 -0
- package/dev/index.html +28 -0
- package/dev/loader.ts +91 -0
- package/dev/pane/index.ts +10 -0
- package/doc/images/panes-for-classes.epgz +0 -0
- package/doc/images/panes-for-classes.svg +609 -0
- package/eslint.config.mjs +34 -0
- package/jest.config.js +27 -0
- package/jest.setup.ts +4 -0
- package/lib/RDFXMLPane.js +59 -0
- package/lib/RDFXMLPane.js.map +1 -0
- package/{dist → lib}/argument/argumentPane.js +15 -14
- package/lib/argument/argumentPane.js.map +1 -0
- package/{dist → lib}/attach/attachPane.js +93 -83
- package/lib/attach/attachPane.js.map +1 -0
- package/{dist → lib}/audio/audioPane.js +50 -49
- package/lib/audio/audioPane.js.map +1 -0
- package/{dist → lib}/classInstancePane.js +24 -23
- package/lib/classInstancePane.js.map +1 -0
- package/lib/dashboard/basicPreferences.js +229 -0
- package/lib/dashboard/basicPreferences.js.map +1 -0
- package/lib/dashboard/dashboardPane.js +73 -0
- package/lib/dashboard/dashboardPane.js.map +1 -0
- package/lib/dashboard/homepage.js +86 -0
- package/lib/dashboard/homepage.js.map +1 -0
- package/{dist → lib}/dataContentPane.js +63 -63
- package/lib/dataContentPane.js.map +1 -0
- package/{dist → lib}/defaultPane.js +15 -14
- package/lib/defaultPane.js.map +1 -0
- package/{dist → lib}/dokieli/dokieliPane.js +53 -49
- package/lib/dokieli/dokieliPane.js.map +1 -0
- package/lib/dokieli/new.js +9 -0
- package/lib/dokieli/new.js.map +1 -0
- package/{dist → lib}/form/pane.js +45 -44
- package/lib/form/pane.js.map +1 -0
- package/lib/global.d.js +2 -0
- package/lib/global.d.js.map +1 -0
- package/lib/home/homePane.js +91 -0
- package/lib/home/homePane.js.map +1 -0
- package/lib/humanReadablePane.js +138 -0
- package/lib/humanReadablePane.js.map +1 -0
- package/lib/imagePane.js +71 -0
- package/lib/imagePane.js.map +1 -0
- package/lib/index.js +112 -0
- package/lib/index.js.map +1 -0
- package/lib/internal/internalPane.js +184 -0
- package/lib/internal/internalPane.js.map +1 -0
- package/lib/mainPage/footer.js +22 -0
- package/lib/mainPage/footer.js.map +1 -0
- package/lib/mainPage/header.js +152 -0
- package/lib/mainPage/header.js.map +1 -0
- package/{dist → lib}/mainPage/index.d.ts.map +1 -1
- package/lib/mainPage/index.js +42 -0
- package/lib/mainPage/index.js.map +1 -0
- package/{dist → lib}/microblogPane/microblogPane.js +262 -261
- package/lib/microblogPane/microblogPane.js.map +1 -0
- package/lib/n3Pane.js +57 -0
- package/lib/n3Pane.js.map +1 -0
- package/lib/outline/context.js +19 -0
- package/lib/outline/context.js.map +1 -0
- package/lib/outline/manager.js +2264 -0
- package/lib/outline/manager.js.map +1 -0
- package/lib/outline/manager.test.d.ts +2 -0
- package/lib/outline/manager.test.d.ts.map +1 -0
- package/lib/outline/manager.test.js +210 -0
- package/lib/outline/manager.test.js.map +1 -0
- package/{dist → lib}/outline/outlineIcons.js +3 -2
- package/lib/outline/outlineIcons.js.map +1 -0
- package/lib/outline/propertyViews.js +44 -0
- package/lib/outline/propertyViews.js.map +1 -0
- package/lib/outline/propertyViews.test.d.ts +2 -0
- package/lib/outline/propertyViews.test.d.ts.map +1 -0
- package/lib/outline/propertyViews.test.js +27 -0
- package/lib/outline/propertyViews.test.js.map +1 -0
- package/{dist → lib}/outline/queryByExample.js +31 -30
- package/lib/outline/queryByExample.js.map +1 -0
- package/{dist → lib}/outline/userInput.js +260 -262
- package/lib/outline/userInput.js.map +1 -0
- package/lib/outline/viewAsImage.js +17 -0
- package/lib/outline/viewAsImage.js.map +1 -0
- package/{dist → lib}/outline/viewAsMbox.js +14 -4
- package/lib/outline/viewAsMbox.js.map +1 -0
- package/lib/pad/padPane.js +417 -0
- package/lib/pad/padPane.js.map +1 -0
- package/{dist → lib}/playlist/playlistPane.js +37 -36
- package/lib/playlist/playlistPane.js.map +1 -0
- package/{dist → lib}/registerPanes.js +29 -29
- package/lib/registerPanes.js.map +1 -0
- package/lib/schedule/formsForSchedule.js +8 -0
- package/{dist → lib}/schedule/formsForSchedule.js.map +1 -1
- package/{dist → lib}/schedule/schedulePane.js +177 -171
- package/lib/schedule/schedulePane.js.map +1 -0
- package/lib/sharing/sharingPane.js +49 -0
- package/lib/sharing/sharingPane.js.map +1 -0
- package/lib/slideshow/slideshowPane.js +84 -0
- package/lib/slideshow/slideshowPane.js.map +1 -0
- package/{dist → lib}/socialPane.js +142 -141
- package/lib/socialPane.js.map +1 -0
- package/lib/tabbed/tabbedPane.js +72 -0
- package/lib/tabbed/tabbedPane.js.map +1 -0
- package/{dist → lib}/tableViewPane.js +9 -8
- package/lib/tableViewPane.js.map +1 -0
- package/lib/test-import-export/common.js +12 -0
- package/lib/test-import-export/common.js.map +1 -0
- package/lib/test-import-export/edit-importer.js +25 -0
- package/lib/test-import-export/edit-importer.js.map +1 -0
- package/lib/test-import-export/testImportExport.js +2 -0
- package/lib/test-import-export/testImportExport.js.map +1 -0
- package/{dist → lib}/transaction/pane.js +118 -117
- package/lib/transaction/pane.js.map +1 -0
- package/{dist → lib}/transaction/period.js +83 -82
- package/lib/transaction/period.js.map +1 -0
- package/{dist → lib}/trip/tripPane.js +48 -47
- package/lib/trip/tripPane.js.map +1 -0
- package/lib/trustedApplications/trustedApplications.dom.js +177 -0
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -0
- package/lib/trustedApplications/trustedApplications.test.d.ts +2 -0
- package/lib/trustedApplications/trustedApplications.test.d.ts.map +1 -0
- package/lib/trustedApplications/trustedApplications.test.js +64 -0
- package/lib/trustedApplications/trustedApplications.test.js.map +1 -0
- package/lib/trustedApplications/trustedApplications.utils.js +34 -0
- package/lib/trustedApplications/trustedApplications.utils.js.map +1 -0
- package/lib/trustedApplications/trustedApplications.view.js +87 -0
- package/lib/trustedApplications/trustedApplications.view.js.map +1 -0
- package/lib/types.js +6 -0
- package/lib/types.js.map +1 -0
- package/{dist → lib}/ui/pane.js +31 -30
- package/lib/ui/pane.js.map +1 -0
- package/lib/versionInfo.d.ts +32 -0
- package/lib/versionInfo.d.ts.map +1 -0
- package/lib/versionInfo.js +37 -0
- package/lib/versionInfo.js.map +1 -0
- package/lib/video/videoPane.js +44 -0
- package/lib/video/videoPane.js.map +1 -0
- package/package.json +13 -26
- package/src/RDFXMLPane.js +60 -0
- package/src/argument/argumentPane.js +65 -0
- package/src/argument/argument_icon_v04.jpg +0 -0
- package/src/argument/icon_argument.png +0 -0
- package/src/argument/transparentyingyang.png +0 -0
- package/src/attach/attachPane.js +508 -0
- package/src/attach/tbl-paperclip-128.png +0 -0
- package/src/attach/tbl-paperclip-22.png +0 -0
- package/src/attach/tbl-paperclip-22a.png +0 -0
- package/src/audio/audioPane.js +197 -0
- package/src/chatPreferencesForm.ttl +12 -0
- package/src/classInstancePane.js +110 -0
- package/src/dashboard/basicPreferences.ts +201 -0
- package/src/dashboard/dashboardPane.ts +83 -0
- package/src/dashboard/homepage.ts +72 -0
- package/src/dashboard/languages/codes.html +8611 -0
- package/src/dashboard/languages/codes.xml +3563 -0
- package/src/dashboard/languages/codes2.txt +170 -0
- package/src/dashboard/languages/foo +70 -0
- package/src/dashboard/languages/foo.ttl +0 -0
- package/src/dashboard/languages/get-language-names.sh +12 -0
- package/src/dashboard/ontologyData.ttl +35 -0
- package/src/dashboard/preferencesFormText.ttl +18 -0
- package/src/dataContentPane.js +290 -0
- package/src/defaultPane.js +102 -0
- package/src/dokieli/Makefile +6 -0
- package/src/dokieli/dokieliPane.js +190 -0
- package/src/dokieli/new.html +30 -0
- package/{dist → src}/dokieli/new.js +3 -9
- package/src/form/form-22.png +0 -0
- package/src/form/form-b-22.png +0 -0
- package/src/form/form.graffle +0 -0
- package/src/form/form.png +0 -0
- package/src/form/pane.js +217 -0
- package/src/form/psuedocode-notes.txt +57 -0
- package/src/global.d.ts +4 -0
- package/src/home/homePane.ts +72 -0
- package/src/humanReadablePane.js +150 -0
- package/src/imagePane.js +75 -0
- package/src/index.ts +71 -0
- package/src/internal/internalPane.ts +263 -0
- package/src/mainPage/footer.ts +19 -0
- package/src/mainPage/header.ts +79 -0
- package/src/mainPage/index.ts +20 -0
- package/src/meeting/Makefile +3 -0
- package/src/meeting/test/meeting1/Actions/actions.ttl +14 -0
- package/src/meeting/test/meeting1/Actions/config.ttl +16 -0
- package/src/meeting/test/meeting1/Actions/state.ttl +30 -0
- package/src/meeting/test/meeting1/Schedule/details.ttl +34 -0
- package/src/meeting/test/meeting1/Schedule/details.ttl.acl +20 -0
- package/src/meeting/test/meeting1/Schedule/forms.ttl +75 -0
- package/src/meeting/test/meeting1/Schedule/forms.ttl.acl +20 -0
- package/src/meeting/test/meeting1/Schedule/index.html +72 -0
- package/src/meeting/test/meeting1/Schedule/index.html.acl +20 -0
- package/src/meeting/test/meeting1/Schedule/results.ttl +15 -0
- package/src/meeting/test/meeting1/Schedule/results.ttl.acl +20 -0
- package/src/meeting/test/meeting1/SharedNotes/pad.ttl +23 -0
- package/src/meeting/test/meeting1/chat/chat.ttl +1 -0
- package/src/meeting/test/meeting1/details.ttl +35 -0
- package/src/meeting/test/meeting1/pad/pad.ttl +16 -0
- package/src/microblogPane/mbStyle.css +267 -0
- package/src/microblogPane/microblogPane.js +1412 -0
- package/src/n3Pane.js +56 -0
- package/src/outline/context.ts +21 -0
- package/src/outline/manager.js +2384 -0
- package/src/outline/manager.test.ts +189 -0
- package/src/outline/outlineIcons.js +160 -0
- package/src/outline/propertyViews.test.ts +36 -0
- package/src/outline/propertyViews.ts +37 -0
- package/src/outline/queryByExample.js +296 -0
- package/src/outline/userInput.js +2373 -0
- package/src/outline/viewAsImage.ts +12 -0
- package/src/outline/viewAsMbox.ts +14 -0
- package/src/pad/images/ColourOff.ai +873 -1
- package/src/pad/images/ColourOff.png +0 -0
- package/src/pad/images/ColourOn.ai +934 -2
- package/src/pad/images/ColourOn.png +0 -0
- package/src/pad/padPane.ts +559 -0
- package/src/playlist/playlistPane.js +161 -0
- package/src/registerPanes.js +147 -0
- package/src/schedule/Makefile +6 -0
- package/{dist → src}/schedule/formsForSchedule.js +2 -9
- package/src/schedule/formsForSchedule.ttl +115 -0
- package/src/schedule/schedulePane.js +1201 -0
- package/src/sharing/sharingPane.ts +49 -0
- package/src/slideshow/slideshowPane.js +80 -0
- package/src/socialPane.js +523 -0
- package/src/style/tabbedtab.css +1347 -0
- package/src/tabbed/tabbedPane.ts +60 -0
- package/src/tableViewPane.js +51 -0
- package/src/test-import-export/common.js +6 -0
- package/src/test-import-export/edit-importer.js +20 -0
- package/src/test-import-export/testImportExport.js +0 -0
- package/src/transaction/068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/075988-3d-transparent-glass-icon-business-currency-british-pound-sc35.png +0 -0
- package/src/transaction/22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/pane.js +629 -0
- package/src/transaction/period.js +374 -0
- package/src/transaction/thumbs_075987-3d-transparent-glass-icon-business-creditcard2.png +0 -0
- package/src/transaction/thumbs_075989-3d-transparent-glass-icon-business-currency-cent-sc35.png +0 -0
- package/src/trip/tripPane.js +176 -0
- package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +176 -0
- package/src/trustedApplications/trustedApplications.dom.ts +276 -0
- package/src/trustedApplications/trustedApplications.test.ts +82 -0
- package/src/trustedApplications/trustedApplications.utils.ts +51 -0
- package/src/trustedApplications/trustedApplications.view.ts +80 -0
- package/src/types.ts +34 -0
- package/src/ui/22-builder.png +0 -0
- package/src/ui/builder.graffle +0 -0
- package/src/ui/builder.png +0 -0
- package/src/ui/builder2.png +0 -0
- package/src/ui/pane.js +226 -0
- package/src/versionInfo.ts +30 -0
- package/src/video/videoPane.js +44 -0
- package/timestamp.sh +13 -0
- package/travis/bumpversion.js +29 -0
- package/tsconfig.json +78 -0
- package/typings/raw-loader.d.ts +4 -0
- package/typings/solid-namespace/index.d.ts +9 -0
- package/webpack.config.js +41 -0
- package/dist/RDFXMLPane.js +0 -58
- package/dist/RDFXMLPane.js.map +0 -1
- package/dist/argument/argumentPane.js.map +0 -1
- package/dist/attach/attachPane.js.map +0 -1
- package/dist/audio/audioPane.js.map +0 -1
- package/dist/classInstancePane.js.map +0 -1
- package/dist/dashboard/basicPreferences.js +0 -155
- package/dist/dashboard/basicPreferences.js.map +0 -1
- package/dist/dashboard/dashboardPane.js +0 -63
- package/dist/dashboard/dashboardPane.js.map +0 -1
- package/dist/dashboard/homepage.js +0 -63
- package/dist/dashboard/homepage.js.map +0 -1
- package/dist/dataContentPane.js.map +0 -1
- package/dist/defaultPane.js.map +0 -1
- package/dist/dokieli/dokieliPane.js.map +0 -1
- package/dist/dokieli/new.js.map +0 -1
- package/dist/form/pane.js.map +0 -1
- package/dist/home/homePane.js +0 -68
- package/dist/home/homePane.js.map +0 -1
- package/dist/humanReadablePane.js +0 -135
- package/dist/humanReadablePane.js.map +0 -1
- package/dist/imagePane.js +0 -70
- package/dist/imagePane.js.map +0 -1
- package/dist/index.js +0 -48
- package/dist/index.js.map +0 -1
- package/dist/internal/internalPane.js +0 -195
- package/dist/internal/internalPane.js.map +0 -1
- package/dist/mainPage/footer.js +0 -16
- package/dist/mainPage/footer.js.map +0 -1
- package/dist/mainPage/header.js +0 -84
- package/dist/mainPage/header.js.map +0 -1
- package/dist/mainPage/index.js +0 -30
- package/dist/mainPage/index.js.map +0 -1
- package/dist/microblogPane/microblogPane.js.map +0 -1
- package/dist/n3Pane.js +0 -56
- package/dist/n3Pane.js.map +0 -1
- package/dist/outline/context.js +0 -13
- package/dist/outline/context.js.map +0 -1
- package/dist/outline/manager.js +0 -1997
- package/dist/outline/manager.js.map +0 -1
- package/dist/outline/outlineIcons.js.map +0 -1
- package/dist/outline/propertyViews.js +0 -33
- package/dist/outline/propertyViews.js.map +0 -1
- package/dist/outline/queryByExample.js.map +0 -1
- package/dist/outline/userInput.js.map +0 -1
- package/dist/outline/viewAsImage.js +0 -7
- package/dist/outline/viewAsImage.js.map +0 -1
- package/dist/outline/viewAsMbox.js.map +0 -1
- package/dist/pad/padPane.js +0 -420
- package/dist/pad/padPane.js.map +0 -1
- package/dist/playlist/playlistPane.js.map +0 -1
- package/dist/registerPanes.js.map +0 -1
- package/dist/schedule/schedulePane.js.map +0 -1
- package/dist/sharing/sharingPane.js +0 -45
- package/dist/sharing/sharingPane.js.map +0 -1
- package/dist/slideshow/slideshowPane.js +0 -80
- package/dist/slideshow/slideshowPane.js.map +0 -1
- package/dist/socialPane.js.map +0 -1
- package/dist/tabbed/tabbedPane.js +0 -55
- package/dist/tabbed/tabbedPane.js.map +0 -1
- package/dist/tableViewPane.js.map +0 -1
- package/dist/transaction/pane.js.map +0 -1
- package/dist/transaction/period.js.map +0 -1
- package/dist/trip/tripPane.js.map +0 -1
- package/dist/trustedApplications/trustedApplications.dom.js +0 -158
- package/dist/trustedApplications/trustedApplications.dom.js.map +0 -1
- package/dist/trustedApplications/trustedApplications.utils.js +0 -24
- package/dist/trustedApplications/trustedApplications.utils.js.map +0 -1
- package/dist/trustedApplications/trustedApplications.view.js +0 -62
- package/dist/trustedApplications/trustedApplications.view.js.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/ui/pane.js.map +0 -1
- package/dist/versionInfo.js +0 -31
- package/dist/versionInfo.js.map +0 -1
- package/dist/video/videoPane.js +0 -43
- package/dist/video/videoPane.js.map +0 -1
- /package/{dist → lib}/dashboard/basicPreferences.d.ts +0 -0
- /package/{dist → lib}/dashboard/basicPreferences.d.ts.map +0 -0
- /package/{dist → lib}/dashboard/dashboardPane.d.ts +0 -0
- /package/{dist → lib}/dashboard/dashboardPane.d.ts.map +0 -0
- /package/{dist → lib}/dashboard/homepage.d.ts +0 -0
- /package/{dist → lib}/dashboard/homepage.d.ts.map +0 -0
- /package/{dist → lib}/home/homePane.d.ts +0 -0
- /package/{dist → lib}/home/homePane.d.ts.map +0 -0
- /package/{dist → lib}/index.d.ts +0 -0
- /package/{dist → lib}/index.d.ts.map +0 -0
- /package/{dist → lib}/internal/internalPane.d.ts +0 -0
- /package/{dist → lib}/internal/internalPane.d.ts.map +0 -0
- /package/{dist → lib}/mainPage/footer.d.ts +0 -0
- /package/{dist → lib}/mainPage/footer.d.ts.map +0 -0
- /package/{dist → lib}/mainPage/header.d.ts +0 -0
- /package/{dist → lib}/mainPage/header.d.ts.map +0 -0
- /package/{dist → lib}/mainPage/index.d.ts +0 -0
- /package/{dist → lib}/outline/context.d.ts +0 -0
- /package/{dist → lib}/outline/context.d.ts.map +0 -0
- /package/{dist → lib}/outline/propertyViews.d.ts +0 -0
- /package/{dist → lib}/outline/propertyViews.d.ts.map +0 -0
- /package/{dist → lib}/outline/viewAsImage.d.ts +0 -0
- /package/{dist → lib}/outline/viewAsImage.d.ts.map +0 -0
- /package/{dist → lib}/outline/viewAsMbox.d.ts +0 -0
- /package/{dist → lib}/outline/viewAsMbox.d.ts.map +0 -0
- /package/{dist → lib}/pad/padPane.d.ts +0 -0
- /package/{dist → lib}/pad/padPane.d.ts.map +0 -0
- /package/{dist → lib}/sharing/sharingPane.d.ts +0 -0
- /package/{dist → lib}/sharing/sharingPane.d.ts.map +0 -0
- /package/{dist → lib}/tabbed/tabbedPane.d.ts +0 -0
- /package/{dist → lib}/tabbed/tabbedPane.d.ts.map +0 -0
- /package/{dist → lib}/trustedApplications/trustedApplications.dom.d.ts +0 -0
- /package/{dist → lib}/trustedApplications/trustedApplications.dom.d.ts.map +0 -0
- /package/{dist → lib}/trustedApplications/trustedApplications.utils.d.ts +0 -0
- /package/{dist → lib}/trustedApplications/trustedApplications.utils.d.ts.map +0 -0
- /package/{dist → lib}/trustedApplications/trustedApplications.view.d.ts +0 -0
- /package/{dist → lib}/trustedApplications/trustedApplications.view.d.ts.map +0 -0
- /package/{dist → lib}/types.d.ts +0 -0
- /package/{dist → lib}/types.d.ts.map +0 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/* istanbul ignore file */
|
|
2
|
+
// The query-by-example functionality in the tabulator
|
|
3
|
+
// was the ability to expore a bit of the web in outline mode,
|
|
4
|
+
// select a ceratain set of fields in the tree,
|
|
5
|
+
// then pres "find all" which would then generte a SPARQL query
|
|
6
|
+
// to find all other places which had the same pattern.
|
|
7
|
+
// Fields could be optional by pressing th ewhite optoional button
|
|
8
|
+
|
|
9
|
+
import { store } from 'solid-logic'
|
|
10
|
+
import * as UI from 'solid-ui'
|
|
11
|
+
|
|
12
|
+
const optionalSubqueriesIndex = []
|
|
13
|
+
|
|
14
|
+
function predParentOf (node) {
|
|
15
|
+
let n = node
|
|
16
|
+
while (true) {
|
|
17
|
+
if (n.getAttribute('predTR')) {
|
|
18
|
+
return n
|
|
19
|
+
} else if (n.previousSibling && n.previousSibling.nodeName === 'TR') {
|
|
20
|
+
n = n.previousSibling
|
|
21
|
+
} else {
|
|
22
|
+
console.log('Could not find predParent')
|
|
23
|
+
return node
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function makeQueryRow (q, tr, constraint) {
|
|
29
|
+
// predtr = predParentOf(tr)
|
|
30
|
+
// var nodes = tr.childNodes
|
|
31
|
+
// var n = tr.childNodes.length
|
|
32
|
+
const inverse = tr.AJAR_inverse
|
|
33
|
+
// var hasVar = 0
|
|
34
|
+
let parentVar, level, pat
|
|
35
|
+
|
|
36
|
+
function makeRDFStatement (freeVar, parent) {
|
|
37
|
+
if (inverse) {
|
|
38
|
+
return new UI.rdf.Statement(freeVar, st.predicate, parent)
|
|
39
|
+
} else {
|
|
40
|
+
return new UI.rdf.Statement(parent, st.predicate, freeVar)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let optionalSubqueryIndex = null
|
|
45
|
+
|
|
46
|
+
for (level = tr.parentNode; level; level = level.parentNode) {
|
|
47
|
+
if (typeof level.AJAR_statement !== 'undefined') {
|
|
48
|
+
// level.AJAR_statement
|
|
49
|
+
level.setAttribute('bla', level.AJAR_statement) // @@? -timbl
|
|
50
|
+
// UI.log.debug("Parent TR statement="+level.AJAR_statement + ", var=" + level.AJAR_variable)
|
|
51
|
+
/* for(let c=0;c<level.parentNode.childNodes.length;c++) //This makes sure the same variable is used for a subject
|
|
52
|
+
if(level.parentNode.childNodes[c].AJAR_variable)
|
|
53
|
+
level.AJAR_variable = level.parentNode.childNodes[c].AJAR_variable; */
|
|
54
|
+
if (!level.AJAR_variable) {
|
|
55
|
+
makeQueryRow(q, level)
|
|
56
|
+
}
|
|
57
|
+
parentVar = level.AJAR_variable
|
|
58
|
+
const predLevel = predParentOf(level)
|
|
59
|
+
if (predLevel.getAttribute('optionalSubqueriesIndex')) {
|
|
60
|
+
optionalSubqueryIndex = predLevel.getAttribute(
|
|
61
|
+
'optionalSubqueriesIndex'
|
|
62
|
+
)
|
|
63
|
+
pat = optionalSubqueriesIndex[optionalSubqueryIndex]
|
|
64
|
+
}
|
|
65
|
+
break
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (!pat) {
|
|
70
|
+
pat = q.pat
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const predtr = predParentOf(tr)
|
|
74
|
+
// /////OPTIONAL KLUDGE///////////
|
|
75
|
+
const opt = predtr.getAttribute('optional')
|
|
76
|
+
if (!opt) {
|
|
77
|
+
if (optionalSubqueryIndex) {
|
|
78
|
+
predtr.setAttribute('optionalSubqueriesIndex', optionalSubqueryIndex)
|
|
79
|
+
} else {
|
|
80
|
+
predtr.removeAttribute('optionalSubqueriesIndex')
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (opt) {
|
|
84
|
+
const optForm = store.formula()
|
|
85
|
+
optionalSubqueriesIndex.push(optForm)
|
|
86
|
+
predtr.setAttribute(
|
|
87
|
+
'optionalSubqueriesIndex',
|
|
88
|
+
optionalSubqueriesIndex.length - 1
|
|
89
|
+
)
|
|
90
|
+
pat.optional.push(optForm)
|
|
91
|
+
pat = optForm
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// //////////////////////////////
|
|
95
|
+
|
|
96
|
+
const st = tr.AJAR_statement
|
|
97
|
+
|
|
98
|
+
const constraintVar = tr.AJAR_inverse ? st.subject : st.object // this is only used for constraints
|
|
99
|
+
let hasParent = true
|
|
100
|
+
if (constraintVar.isBlank && constraint) {
|
|
101
|
+
window.alert(
|
|
102
|
+
'You cannot constrain a query with a blank node. No constraint will be added.'
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
if (!parentVar) {
|
|
106
|
+
hasParent = false
|
|
107
|
+
parentVar = inverse ? st.object : st.subject // if there is no parents, uses the sub/obj
|
|
108
|
+
}
|
|
109
|
+
// UI.log.debug('Initial variable: '+tr.AJAR_variable)
|
|
110
|
+
const v = tr.AJAR_variable
|
|
111
|
+
? tr.AJAR_variable
|
|
112
|
+
: store.variable(UI.utils.newVariableName())
|
|
113
|
+
q.vars.push(v)
|
|
114
|
+
v.label = hasParent ? parentVar.label : UI.utils.label(parentVar)
|
|
115
|
+
v.label += ' ' + UI.utils.predicateLabelForXML(st.predicate, inverse)
|
|
116
|
+
const pattern = makeRDFStatement(v, parentVar)
|
|
117
|
+
// alert(pattern)
|
|
118
|
+
v.label = v.label.slice(0, 1).toUpperCase() + v.label.slice(1) // init cap
|
|
119
|
+
|
|
120
|
+
// See ../rdf/sparql.js
|
|
121
|
+
// This should only work on literals but doesn't.
|
|
122
|
+
function ConstraintEqualTo (value) {
|
|
123
|
+
this.describe = function (varstr) {
|
|
124
|
+
return varstr + ' = ' + value.toNT()
|
|
125
|
+
}
|
|
126
|
+
this.test = function (term) {
|
|
127
|
+
return value.sameTerm(term)
|
|
128
|
+
}
|
|
129
|
+
return this
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (constraint) {
|
|
133
|
+
// binds the constrained variable to its selected value
|
|
134
|
+
pat.constraints[v] = new ConstraintEqualTo(constraintVar)
|
|
135
|
+
}
|
|
136
|
+
UI.log.info('Pattern: ' + pattern)
|
|
137
|
+
pattern.tr = tr
|
|
138
|
+
tr.AJAR_pattern = pattern // Cross-link UI and query line
|
|
139
|
+
tr.AJAR_variable = v
|
|
140
|
+
// UI.log.debug('Final variable: '+tr.AJAR_variable)
|
|
141
|
+
UI.log.debug('Query pattern: ' + pattern)
|
|
142
|
+
pat.statements.push(pattern)
|
|
143
|
+
return v
|
|
144
|
+
} // makeQueryRow
|
|
145
|
+
|
|
146
|
+
function saveQuery (selection, qs) {
|
|
147
|
+
// var qs = outline.qs // @@
|
|
148
|
+
const q = new UI.rdf.Query()
|
|
149
|
+
const n = selection.length
|
|
150
|
+
let i, sel, st, tr
|
|
151
|
+
for (i = 0; i < n; i++) {
|
|
152
|
+
sel = selection[i]
|
|
153
|
+
tr = sel.parentNode
|
|
154
|
+
st = tr.AJAR_statement
|
|
155
|
+
UI.log.debug('Statement ' + st)
|
|
156
|
+
if (sel.getAttribute('class').indexOf('pred') >= 0) {
|
|
157
|
+
UI.log.info(' We have a predicate')
|
|
158
|
+
makeQueryRow(q, tr)
|
|
159
|
+
}
|
|
160
|
+
if (sel.getAttribute('class').indexOf('obj') >= 0) {
|
|
161
|
+
UI.log.info(' We have an object')
|
|
162
|
+
makeQueryRow(q, tr, true)
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
qs.addQuery(q)
|
|
166
|
+
|
|
167
|
+
function resetOutliner (pat) {
|
|
168
|
+
const n = pat.statements.length
|
|
169
|
+
let pattern, tr
|
|
170
|
+
for (let i = 0; i < n; i++) {
|
|
171
|
+
pattern = pat.statements[i]
|
|
172
|
+
tr = pattern.tr
|
|
173
|
+
// UI.log.debug('tr: ' + tr.AJAR_statement);
|
|
174
|
+
if (typeof tr !== 'undefined') {
|
|
175
|
+
tr.AJAR_pattern = null // TODO: is this == to whats in current version?
|
|
176
|
+
tr.AJAR_variable = null
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
for (const x in pat.optional) {
|
|
180
|
+
resetOutliner(pat.optional[x])
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
resetOutliner(q.pat)
|
|
184
|
+
// NextVariable=0;
|
|
185
|
+
return q
|
|
186
|
+
} // saveQuery
|
|
187
|
+
|
|
188
|
+
// When the user asks for all list of all matching parts of the data
|
|
189
|
+
//
|
|
190
|
+
export function viewAndSaveQuery (outline, selection) {
|
|
191
|
+
const qs = outline.qs
|
|
192
|
+
UI.log.info('outline.doucment is now ' + outline.document.location)
|
|
193
|
+
const q = saveQuery(selection, qs)
|
|
194
|
+
/*
|
|
195
|
+
if (tabulator.isExtension) {
|
|
196
|
+
// tabulator.drawInBestView(q)
|
|
197
|
+
} else
|
|
198
|
+
*/
|
|
199
|
+
|
|
200
|
+
for (let i = 0; i < qs.listeners.length; i++) {
|
|
201
|
+
qs.listeners[i].getActiveView().view.drawQuery(q)
|
|
202
|
+
qs.listeners[i].updateQueryControls(qs.listeners[i].getActiveView())
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The QuerySource object stores a set of listeners and a set of queries.
|
|
208
|
+
* It keeps the listeners aware of those queries that the source currently
|
|
209
|
+
* contains, and it is then up to the listeners to decide what to do with
|
|
210
|
+
* those queries in terms of displays.
|
|
211
|
+
* Not used 2010-08 -- TimBL
|
|
212
|
+
* @class QuerySource
|
|
213
|
+
* @author jambo
|
|
214
|
+
*/
|
|
215
|
+
|
|
216
|
+
export function QuerySource () {
|
|
217
|
+
/**
|
|
218
|
+
* stores all of the queries currently held by this source,
|
|
219
|
+
* indexed by ID number.
|
|
220
|
+
*/
|
|
221
|
+
this.queries = []
|
|
222
|
+
/**
|
|
223
|
+
* stores the listeners for a query object.
|
|
224
|
+
* @see TabbedContainer
|
|
225
|
+
*/
|
|
226
|
+
this.listeners = []
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* add a Query object to the query source--It will be given an ID number
|
|
230
|
+
* and a name, if it doesn't already have one. This subsequently adds the
|
|
231
|
+
* query to all of the listeners the QuerySource knows about.
|
|
232
|
+
*/
|
|
233
|
+
this.addQuery = function (q) {
|
|
234
|
+
let i
|
|
235
|
+
if (q.name === null || q.name === '') {
|
|
236
|
+
q.name = 'Query #' + (this.queries.length + 1)
|
|
237
|
+
}
|
|
238
|
+
q.id = this.queries.length
|
|
239
|
+
this.queries.push(q)
|
|
240
|
+
for (i = 0; i < this.listeners.length; i++) {
|
|
241
|
+
if (this.listeners[i] !== null) {
|
|
242
|
+
this.listeners[i].addQuery(q)
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Remove a Query object from the source. Tells all listeners to also
|
|
249
|
+
* remove the query.
|
|
250
|
+
*/
|
|
251
|
+
this.removeQuery = function (q) {
|
|
252
|
+
let i
|
|
253
|
+
for (i = 0; i < this.listeners.length; i++) {
|
|
254
|
+
if (this.listeners[i] !== null) {
|
|
255
|
+
this.listeners[i].removeQuery(q)
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (this.queries[q.id] !== null) {
|
|
259
|
+
delete this.queries[q.id]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* adds a "Listener" to this QuerySource - that is, an object
|
|
265
|
+
* which is capable of both adding and removing queries.
|
|
266
|
+
* Currently, only the TabbedContainer class is added.
|
|
267
|
+
* also puts all current queries into the listener to be used.
|
|
268
|
+
*/
|
|
269
|
+
this.addListener = function (listener) {
|
|
270
|
+
let i
|
|
271
|
+
this.listeners.push(listener)
|
|
272
|
+
for (i = 0; i < this.queries.length; i++) {
|
|
273
|
+
if (this.queries[i] !== null) {
|
|
274
|
+
listener.addQuery(this.queries[i])
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* removes listener from the array of listeners, if it exists! Also takes
|
|
280
|
+
* all of the queries from this source out of the listener.
|
|
281
|
+
*/
|
|
282
|
+
this.removeListener = function (listener) {
|
|
283
|
+
let i
|
|
284
|
+
for (i = 0; i < this.queries.length; i++) {
|
|
285
|
+
if (this.queries[i] !== null) {
|
|
286
|
+
listener.removeQuery(this.queries[i])
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
for (i = 0; i < this.listeners.length; i++) {
|
|
291
|
+
if (this.listeners[i] === listener) {
|
|
292
|
+
delete this.listeners[i]
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|