├── .agignore ├── .eslintrc.yml ├── .gitignore ├── CHANGELOG.md ├── Gruntfile.js ├── LICENSE ├── README.md ├── bower.json ├── dist ├── semantic-faceted-search.css └── semantic-faceted-search.js ├── docs ├── css │ ├── animations.css │ ├── bootstrap.min.css │ ├── doc_widgets.css │ ├── docs.css │ ├── font-awesome.css │ └── prettify.css ├── font │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ └── fontawesome-webfont.woff ├── index.html ├── js │ ├── angular-bootstrap-prettify.js │ ├── angular-bootstrap.js │ ├── angular.min.js │ ├── docs-setup.js │ ├── docs.js │ ├── google-code-prettify.js │ └── marked.js └── partials │ └── api │ ├── index.html │ ├── seco.facetedSearch.FacetHandler.html │ ├── seco.facetedSearch.FacetResultHandler.html │ ├── seco.facetedSearch.directive.secoBasicFacet.html │ ├── seco.facetedSearch.directive.secoCheckboxFacet.html │ ├── seco.facetedSearch.directive.secoFacetWrapper.html │ ├── seco.facetedSearch.directive.secoHierarchyFacet.html │ ├── seco.facetedSearch.directive.secoJenaTextFacet.html │ ├── seco.facetedSearch.directive.secoTextFacet.html │ ├── seco.facetedSearch.directive.secoTimespanFacet.html │ ├── seco.facetedSearch.facetUrlStateHandlerService.html │ └── seco.facetedSearch.html ├── package-lock.json ├── package.json ├── src ├── css │ └── facets.css ├── facets │ ├── basic │ │ ├── facets.basic-facet.controller.js │ │ ├── facets.basic-facet.directive.html │ │ ├── facets.basic-facet.directive.js │ │ └── facets.basic-facet.facet.js │ ├── checkbox │ │ ├── facets.checkbox-facet.controller.js │ │ ├── facets.checkbox-facet.directive.html │ │ ├── facets.checkbox-facet.directive.js │ │ └── facets.checkbox-facet.facet.js │ ├── facets.abstract-facet.controller.js │ ├── facets.chart.service.js │ ├── facets.facet-handler.service.js │ ├── facets.facet-mapper-service.js │ ├── facets.facet-wrapper.directive.html │ ├── facets.facet-wrapper.directive.js │ ├── facets.facetEndpoint.service.js │ ├── facets.module.js │ ├── facets.text-with-selection.filter.js │ ├── hierarchy │ │ ├── facets.hierarchy-facet.controller.js │ │ ├── facets.hierarchy-facet.directive.js │ │ └── facets.hierarchy-facet.facet.js │ ├── jena-text │ │ ├── facets.jena-text-facet.controller.js │ │ ├── facets.jena-text-facet.directive.js │ │ └── facets.jena-text-facet.facet.js │ ├── text │ │ ├── facets.text-facet.controller.js │ │ ├── facets.text-facet.directive.html │ │ ├── facets.text-facet.directive.js │ │ └── facets.text-facet.facet.js │ └── timespan │ │ ├── facets.timespan-facet.controller.js │ │ ├── facets.timespan-facet.directive.html │ │ ├── facets.timespan-facet.directive.js │ │ ├── facets.timespan-facet.facet.js │ │ └── facets.timespan-mapper-service.js ├── faceturlstate │ └── faceturlstate.url-state-handler-service.js └── results │ └── results.service.js └── tests ├── facets.basic-facet.controller.spec.js ├── facets.basic-facet.facet.spec.js ├── facets.checkbox-facet.facet.spec.js ├── facets.facet-handler.service.spec.js ├── facets.hierarchy-facet.facet.spec.js ├── facets.jena-text-facet.facet.spec.js ├── facets.text-facet.controller.spec.js ├── facets.text-facet.facet.spec.js ├── facets.timespan-facet.facet.spec.js └── karma.conf.js /.agignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | docs/ 3 | -------------------------------------------------------------------------------- /.eslintrc.yml: -------------------------------------------------------------------------------- 1 | rules: 2 | indent: 3 | - 2 4 | - 4 5 | - SwitchCase: 1 6 | MemberExpression: "off" 7 | FunctionDeclaration: 8 | parameters: 2 9 | quotes: 10 | - 2 11 | - single 12 | linebreak-style: 13 | - 2 14 | - unix 15 | semi: 16 | - 2 17 | - always 18 | env: 19 | browser: true 20 | globals: 21 | jQuery: false 22 | angular: false 23 | extends: "eslint:recommended" 24 | plugins: 25 | - angular 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .idea 3 | *.swp 4 | bower_components 5 | node_modules 6 | 7 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](http://keepachangelog.com/), 6 | and this project adheres to [Semantic Versioning](http://semver.org/). 7 | 8 | ## [Unreleased] 9 | 10 | ## [1.11.0] - 2018-05-18 11 | 12 | ### Added 13 | 14 | - Configuration option for displaying facets as pie charts. If the option `chart` is truthy, 15 | the user can click a button next to the disable facet button to see and interact with the 16 | facet as a pie chart. The option is applicable for 17 | [BasicFacet](http://semanticcomputing.github.io/angular-semantic-faceted-search/#/api/seco.facetedSearch.directive:secoBasicFacet) 18 | and [CheckboxFacet](http://semanticcomputing.github.io/angular-semantic-faceted-search/#/api/seco.facetedSearch.directive:secoCheckboxFacet). 19 | It also works with 20 | [HierachyFacet](http://semanticcomputing.github.io/angular-semantic-faceted-search/#/api/seco.facetedSearch.directive:secoHierarchyFacet), 21 | but the hierarchy is not visualized, so usage with that facet is not recommended. 22 | The option is disabled by default. 23 | 24 | ## [1.10.0] - 2018-03-13 25 | 26 | ### Changed 27 | 28 | - Cosmetic changes: 29 | - Facet disable button is now more subtle. 30 | - The enable/disable button is consistently placed. 31 | - Loading spinner is smaller. 32 | - Refactored facet templates (this has some DOM/CSS implications). 33 | 34 | ## [1.9.1] - 2017-11-28 35 | 36 | ### Fixed 37 | 38 | - Disabling and enabling a facet now works, instead of leaving the facet 39 | unresponsive. 40 | 41 | ## [1.9.0] - 2017-11-27 42 | 43 | ### Changed 44 | 45 | - When an error occurs, don't try to display the error message to the user. 46 | 47 | ## [1.8.1] - 2017-10-16 48 | 49 | ### Changed 50 | 51 | - Optimize hierarchy facet constraint. 52 | 53 | ## [1.8.0] - 2017-09-14 54 | 55 | ### Changed 56 | 57 | - Add configuration option for HTTP headers. 58 | 59 | ## [1.7.2] - 2017-08-07 60 | 61 | ### Fixed 62 | 63 | - Make the `priority` option work. 64 | 65 | ## [1.7.1] - 2017-08-03 66 | 67 | ### Changed 68 | 69 | - Hierarchical facet now supports the `specifier` option. 70 | - Hierarchical facet now displays only one dash per level in the hierarchy. 71 | 72 | ## [1.7.0] - 2017-07-26 73 | 74 | ### Changed 75 | 76 | - Hierarchical facet now supports multiple levels in the hierarchy. 77 | The `classes` option is no longer needed. 78 | 79 | ## [1.6.1] - 2017-07-24 80 | 81 | ### Changed 82 | 83 | - Update angular-spinner dependency. 84 | 85 | ## [1.6.0] - 2017-07-14 86 | 87 | ### Changed 88 | 89 | - Make release version safe for minification. 90 | 91 | ## [1.5.4] - 2017-07-11 92 | 93 | ### Fixed 94 | 95 | - Hierarchical facet now always shows all values. 96 | 97 | ## [1.5.3] - 2017-05-02 98 | 99 | ### Fixed 100 | 101 | - FacetResultHandler now works without paging. 102 | 103 | ## [1.5.2] - 2017-03-27 104 | 105 | ### Fixed 106 | 107 | - Queries to additional endpoints now return labels for values. 108 | 109 | ## [1.5.1] - 2017-03-24 110 | 111 | ### Fixed 112 | 113 | - Timespan facet does not break anymore if its query returns undefined dates. 114 | 115 | ## [1.5.0] - 2017-03-15 116 | 117 | ### Added 118 | 119 | - Checkbox facet (secoCheckboxFacet) 120 | 121 | ### Changed 122 | 123 | - Simplified facet state update 124 | - BasicFacet no longer does federated queries - a separate query for each 125 | service is produced instead. 126 | - Multiple languages can now be given as the `preferredLang`. 127 | 128 | ## [1.4.1] - 2017-01-16 129 | 130 | ### Changed 131 | - Values for the timespan facet are now cast as xsd:date in SPARQL 132 | 133 | ### Fixed 134 | - Fix timespan facet date limits when selection changes 135 | 136 | ## [1.4.0] - 2017-01-11 137 | 138 | ### Changed 139 | - Selecting a value in a basic facet does not update the list of selections anymore. 140 | This way the user can change the selection without clearing the selection first. 141 | - Facet selections should now work with all literal datatypes. 142 | 143 | ## [1.3.2] - 2016-12-15 144 | 145 | ### Fixed 146 | - Timespan facet selections restrictions fixed. 147 | 148 | ## [1.3.1] - 2016-11-15 149 | 150 | ### Fixed 151 | - Sanitize the user's query in secoJenaTextFacet to avoid syntax errors from the 152 | SPARQL endpoint. 153 | 154 | ## [1.3.0] - 2016-11-15 155 | 156 | ### Changed 157 | - secoJenaTextFacet allows for more user control in the search. 158 | I.e. it does not modify the user input except for excaping quotes 159 | (and removing them if they are unbalanced) 160 | - secoJenaTextFacet default priority is now 0 (instead of 10). 161 | 162 | ## [1.2.1] - 2016-11-15 163 | 164 | ### Added 165 | - `limit` and `graph` configuration options for secoJenaTextFacet. 166 | 167 | ## [1.2.0] - 2016-11-14 168 | 169 | ### Added 170 | - [secoJenaTextFacet](http://semanticcomputing.github.io/angular-semantic-faceted-search/#/api/seco.facetedSearch.directive:secoJenaTextFacet) 171 | - `priority` configuration variable to provide a way to sort the facet constraints (see the [documentation][api]). 172 | 173 | 174 | ## [1.1.1] - 2016-11-04 175 | 176 | ### Fixed 177 | - Dates are hard. Dates should now appear the same in queries, URL params, 178 | and in the date picker, regardless of the user's timezone. 179 | 180 | ## [1.1.0] - 2016-11-03 181 | 182 | ### Changed 183 | - Timespan facet now works as an actual facet by querying for minimum and maximum 184 | available dates, and adjusts the datepicker max and min dates accordingly. 185 | 186 | ## [1.0.7] - 2016-11-03 187 | 188 | ### Fixed 189 | - Fix setting the timespan face's initial values. 190 | - Fix an issue with the timespan facet where the selected date could be different 191 | from the one actually used in the query. 192 | 193 | ## [1.0.6] - 2016-11-02 194 | 195 | ### Added 196 | - Changelog 197 | 198 | ### Changed 199 | - UI Bootstrap dependency updated to ^2.2.0 200 | 201 | ### Fixed 202 | - Fix the timespan facet, and its documentation 203 | 204 | [Unreleased]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.11.0...HEAD 205 | [1.11.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.10.0...1.11.0 206 | [1.10.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.9.1...1.10.0 207 | [1.9.1]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.9.0...1.9.1 208 | [1.9.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.8.1...1.9.0 209 | [1.8.1]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.8.0...1.8.1 210 | [1.8.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.7.1...1.8.0 211 | [1.7.1]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.7.0...1.7.1 212 | [1.7.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.6.1...1.7.0 213 | [1.6.1]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.6.0...1.6.1 214 | [1.6.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.5.4...1.6.0 215 | [1.5.4]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.5.3...1.5.4 216 | [1.5.3]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.5.2...1.5.3 217 | [1.5.2]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.5.1...1.5.2 218 | [1.5.1]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.5.0...1.5.1 219 | [1.5.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.4.1...1.5.0 220 | [1.4.1]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.4.0...1.4.1 221 | [1.4.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.3.2...1.4.0 222 | [1.3.2]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.3.1...1.3.2 223 | [1.3.1]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.3.0...1.3.1 224 | [1.3.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.2.1...1.3.0 225 | [1.2.1]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.2.0...1.2.1 226 | [1.2.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.1.1...1.2.0 227 | [1.1.1]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.0.7...1.1.1 228 | [1.1.0]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.0.7...1.1.0 229 | [1.0.7]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.0.6...1.0.7 230 | [1.0.6]: https://github.com/SemanticComputing/angular-semantic-faceted-search/compare/1.0.5...1.0.6 231 | [api]: http://semanticcomputing.github.io/angular-semantic-faceted-search/#/api 232 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* global module */ 4 | module.exports = function(grunt) { 5 | 6 | grunt.initConfig({ 7 | ngtemplates: { 8 | 'seco.facetedSearch': { 9 | src: [ 10 | 'src/facets/facets.facet-wrapper.directive.html', 11 | 'src/facets/basic/facets.basic-facet.directive.html', 12 | 'src/facets/text/facets.text-facet.directive.html', 13 | 'src/facets/timespan/facets.timespan-facet.directive.html', 14 | 'src/facets/checkbox/facets.checkbox-facet.directive.html' 15 | ], 16 | dest: 'dist/templates.js' 17 | } 18 | }, 19 | concat: { 20 | js: { 21 | src: [ 22 | 'src/facets/facets.module.js', 23 | 'src/faceturlstate/faceturlstate.url-state-handler-service.js', 24 | 'src/results/results.service.js', 25 | 'src/facets/facets.facetEndpoint.service.js', 26 | 'src/facets/facets.facet-mapper-service.js', 27 | 'src/facets/facets.facet-selection-formatter.js', 28 | 'src/facets/facets.facet-handler.service.js', 29 | 'src/facets/facets.facet-wrapper.directive.js', 30 | 'src/facets/facets.text-with-selection.filter.js', 31 | 'src/facets/facets.abstract-facet.controller.js', 32 | 'src/facets/facets.chart.service.js', 33 | 'src/facets/basic/facets.basic-facet.facet.js', 34 | 'src/facets/basic/facets.basic-facet.controller.js', 35 | 'src/facets/basic/facets.basic-facet.directive.js', 36 | 'src/facets/text/facets.text-facet.facet.js', 37 | 'src/facets/text/facets.text-facet.controller.js', 38 | 'src/facets/text/facets.text-facet.directive.js', 39 | 'src/facets/jena-text/facets.jena-text-facet.facet.js', 40 | 'src/facets/jena-text/facets.jena-text-facet.controller.js', 41 | 'src/facets/jena-text/facets.jena-text-facet.directive.js', 42 | 'src/facets/timespan/facets.timespan-mapper-service.js', 43 | 'src/facets/timespan/facets.timespan-facet.facet.js', 44 | 'src/facets/timespan/facets.timespan-facet.controller.js', 45 | 'src/facets/timespan/facets.timespan-facet.directive.js', 46 | 'src/facets/checkbox/facets.checkbox-facet.facet.js', 47 | 'src/facets/checkbox/facets.checkbox-facet.controller.js', 48 | 'src/facets/checkbox/facets.checkbox-facet.directive.js', 49 | 'src/facets/hierarchy/facets.hierarchy-facet.facet.js', 50 | 'src/facets/hierarchy/facets.hierarchy-facet.controller.js', 51 | 'src/facets/hierarchy/facets.hierarchy-facet.directive.js', 52 | 'dist/templates.js' 53 | ], 54 | dest: 'dist/semantic-faceted-search.js' 55 | }, 56 | css: { 57 | src: ['src/css/facets.css'], 58 | dest: 'dist/semantic-faceted-search.css' 59 | } 60 | }, 61 | clean: { 62 | templates: ['dist/templates.js'] 63 | }, 64 | ngdocs: { 65 | all: ['src/**/*.js'], 66 | sourceLink: true, 67 | options: { 68 | title: 'SPARQL Faceter' 69 | } 70 | }, 71 | ngAnnotate: { 72 | options: { 73 | singleQuotes: true 74 | }, 75 | dist: { 76 | files: { 77 | 'dist/semantic-faceted-search.js': 'dist/semantic-faceted-search.js', 78 | } 79 | } 80 | }, 81 | }); 82 | 83 | grunt.loadNpmTasks('grunt-angular-templates'); 84 | grunt.loadNpmTasks('grunt-contrib-concat'); 85 | grunt.loadNpmTasks('grunt-contrib-clean'); 86 | grunt.loadNpmTasks('grunt-ng-annotate'); 87 | grunt.loadNpmTasks('grunt-ngdocs'); 88 | 89 | grunt.registerTask('build', [ 90 | 'ngtemplates', 91 | 'concat:js', 92 | 'ngAnnotate', 93 | 'concat:css', 94 | 'clean:templates' 95 | ]); 96 | 97 | grunt.registerTask('doc', [ 98 | 'ngdocs:all' 99 | ]); 100 | }; 101 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Erkki Heino, Mikko Koho 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SPARQL Faceter 2 | 3 | A paper describing SPARQL Faceter can be found [here](http://seco.cs.aalto.fi/publications/2016/koho-et-al-sparql-faceter.pdf), 4 | although as of version 1.0.0 the implementation is quite different. 5 | Most importantly, rather than there being one SPARQL query to get the state of all the facets, 6 | each facet makes its own query. 7 | 8 | ## Installation 9 | 10 | Install via Bower: 11 | 12 | `bower install sparql-faceter` 13 | 14 | or 15 | 16 | `npm install sparql-faceter` 17 | 18 | Include `seco.facetedSearch` in your module dependencies: 19 | 20 | ``` 21 | angular.module('myApp', ['seco.facetedSearch']) 22 | ``` 23 | 24 | Include the script in your HTML: 25 | 26 | ``` 27 | 79 | 80 | 81 |
82 |