Skip to content
Permalink
Browse files
Change repository scope to jQuery widget only.
  • Loading branch information
RubenVerborgh committed Jun 24, 2015
1 parent eb87769 commit 1e63f07ee960e340bba816e8b6216912b196ce00
Showing with 29 additions and 84 deletions.
  1. +2 −2 .gitignore
  2. +15 −20 README.md
  3. +3 −2 {query-ui → }/build-minified
  4. BIN {query-ui → }/favicon.ico
  5. BIN {query-ui → }/images/chosen-sprite.png
  6. BIN {query-ui → }/images/chosen-sprite@2x.png
  7. +5 −5 {query-ui → }/index.html
  8. +1 −1 query-ui/query-state.js → ldf-client-jquery-url.js
  9. +1 −1 query-ui/query-ui.js → ldf-client-jquery.js
  10. 0 {query-ui → }/ldf-client.css
  11. +1 −1 package.json
  12. 0 query-ui/build-queries → queries-to-json
  13. 0 {query-ui → }/queries/dbpedia2014/airports-italy.sparql
  14. 0 {query-ui → }/queries/dbpedia2014/ancient-cities.sparql
  15. 0 {query-ui → }/queries/dbpedia2014/authors-books.sparql
  16. 0 {query-ui → }/queries/dbpedia2014/award-ceremonies.sparql
  17. 0 {query-ui → }/queries/dbpedia2014/bands-queen.sparql
  18. 0 {query-ui → }/queries/dbpedia2014/belgian-software.sparql
  19. 0 {query-ui → }/queries/dbpedia2014/brad-pitt.sparql
  20. 0 {query-ui → }/queries/dbpedia2014/carpenters-crucifixion.sparql
  21. 0 {query-ui → }/queries/dbpedia2014/common-jesus.sparql
  22. 0 {query-ui → }/queries/dbpedia2014/death-causes-actors.sparql
  23. 0 {query-ui → }/queries/dbpedia2014/desserts-plants.sparql
  24. 0 {query-ui → }/queries/dbpedia2014/events-trentino.sparql
  25. 0 {query-ui → }/queries/dbpedia2014/indian-dishes.sparql
  26. 0 {query-ui → }/queries/dbpedia2014/michael-jackson.sparql
  27. 0 {query-ui → }/queries/dbpedia2014/natalie-portman.sparql
  28. 0 {query-ui → }/queries/dbpedia2014/os-raspberrypi.sparql
  29. 0 {query-ui → }/queries/dbpedia2014/picasso.sparql
  30. 0 {query-ui → }/queries/dbpedia2014/places-obama.sparql
  31. 0 {query-ui → }/queries/dbpedia2014/soccer.sparql
  32. 0 {query-ui → }/queries/dbpedia2014/women-mythology.sparql
  33. 0 {query-ui → }/queries/default/first-triples.sparql
  34. 0 {query-ui → }/queries/default/labels.sparql
  35. 0 {query-ui → }/queries/default/types.sparql
  36. 0 {query-ui → }/queries/kbodata/active-registered.sparql
  37. 0 {query-ui → }/queries/kbodata/activities.sparql
  38. 0 {query-ui → }/queries/kbodata/juridical-forms.sparql
  39. 0 {query-ui → }/queries/kbodata/limited-companies.sparql
  40. 0 {query-ui → }/queries/kbodata/telecom.sparql
  41. 0 {query-ui → }/queries/lov/all-extending-classes.sparql
  42. 0 {query-ui → }/queries/lov/licenses-used.sparql
  43. 0 {query-ui → }/queries/lov/your-own-vocabularies.sparql
  44. 0 {query-ui → }/queries/ugent-biblio/coauthors.sparql
  45. 0 {query-ui → }/queries/ugent-biblio/publications.sparql
  46. 0 {query-ui → }/queries/ugent-biblio/thomson.sparql
  47. 0 {query-ui → }/queries/viaf/cubism.sparql
  48. +0 −48 query-pull-based/index.html
  49. +0 −3 query-ui/build-all
  50. +1 −1 {query-ui → }/settings.json
@@ -1,5 +1,5 @@
node_modules
*.log
*/build
build
deps/ldf-client-browser.js
query-ui/queries.json
queries.json
@@ -1,35 +1,30 @@
# Linked Data Fragments Browser Client
# Linked Data Fragments jQuery Widget

**[Try the _Linked Data Fragments Web Client_ online.](http://client.linkeddatafragments.org/)**
**[Try the _Linked Data Fragments jQuery Widget_ online.](http://client.linkeddatafragments.org/)**
[<img src="http://linkeddatafragments.org/images/logo.svg" width="100" align="right" alt="" />](http://linkeddatafragments.org/)

This repository contains a browser interface to the [Linked Data Fragments client](https://github.com/LinkedDataFragments/Client).
<br>
In addition, it shows how to create applications using the [_ldf-client_ library](https://github.com/LinkedDataFragments/Client.js).
This jQuery widget is a browser-based user interface to the [Linked Data Fragments client](https://github.com/LinkedDataFragments/Client).
It allows users to execute SPARQL queries over one or multiple datasets exposed through a [Triple Pattern Fragments interface](http://www.hydra-cg.com/spec/latest/triple-pattern-fragments/).

## Using the code
- Run `npm install` to fetch dependencies and build the browser version of the client code.
- Place the files from this repository on a local Web server
(for instance, by starting a tool such as [https://github.com/ddfreyne/adsf] in the root folder).
- Open `index.html` in the browser through your Web server (typically `http://localhost:3000/`).
- Edit datasources in `settings.json` and queries in the `queries` folder, and run `queries-to-json` to compile both of them in a single JSON file.
- Run `./build-minified` to generate a production version in the `build` folder.

## How the browser client works
The original _ldf-client_ library is written for the Node.js environment. This repository shows how to compile it using [browserify](http://browserify.org/) to make it compatible with browsers.
The original _ldf-client_ library is written for the Node.js environment. The [browserify](http://browserify.org/) library makes it compatible with browsers.

The file `browser.js` makes the Node.js library _ldf-client_ available in global scope as `ldf`.
<br>
This script is compiled with its dependencies to `deps/ldf-client-browser.js` via `npm run postinstall`.

You can use the resulting `ldf-client-browser.js` in your browser applications.

## Examples in this repository
- **query-ui:** a user interface to execute SPARQL queries ([demo](http://client.linkeddatafragments.org/))
- **query-pull-based:** retrieve results on-demand, instead of streaming them all

## Compiling the browser client
```bash
$ npm install # install dependencies and compile browser script
$ cd query-ui
$ ./build-queries # create the JSON version of the example queries
$ ./build-minified # create a minified version in query-ui/build/
```
You can use the resulting `ldf-client-browser.js` in your browser applications; it is independent of the jQuery UI widget.

## License
The Linked Data Fragments Browser Client is written by [Ruben Verborgh](http://ruben.verborgh.org/).
The Linked Data Fragments jQuery Widget is written by [Ruben Verborgh](http://ruben.verborgh.org/).

This code is copyrighted by [Multimedia Lab – iMinds – Ghent University](http://mmlab.be/)
and released under the [MIT license](http://opensource.org/licenses/MIT).
@@ -20,8 +20,8 @@ html = html.replace(/\s*<script src="([^"]+)"><\/script>\s*/g, function (match,
});
if (scriptFiles.length) {
minifiedScript = UglifyJS.minify(scriptFiles, { output: { comments: /^!/ } });
fs.writeFileSync(path.join(scriptsDir, 'ldf-query-ui.js'), minifiedScript.code);
html = html.replace('</body>', '<script src="scripts/ldf-query-ui.js"></script>\n</body>');
fs.writeFileSync(path.join(scriptsDir, 'ldf-client-jquery-packaged.js'), minifiedScript.code);
html = html.replace('</body>', '<script src="scripts/ldf-client-jquery-packaged.js"></script>\n</body>');
}

// Bundle all inline scripts into a single script
@@ -42,6 +42,7 @@ copy(path.join(sourceDir, 'queries.json'), path.join(outputDir, 'queries.json'))
fs.readdirSync(path.join(sourceDir, 'images')).forEach(function (image) {
copy(path.join(sourceDir, 'images', image), path.join(imagesDir, image));
});
copy(path.join(sourceDir, 'favicon.ico'), path.join(outputDir, 'favicon.ico'));

// Write the output HTML
fs.writeFileSync(path.join(outputDir, 'index.html'), html);
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -4,11 +4,11 @@
<head>
<meta charset="utf-8">
<title>Linked Data Fragments client</title>
<script src="../deps/jquery-2.1.0.js"></script>
<script src="../deps/chosen-1.1.0.js"></script>
<script src="../deps/ldf-client-browser.js"></script>
<script src="query-ui.js"></script>
<script src="query-state.js"></script>
<script src="deps/jquery-2.1.0.js"></script>
<script src="deps/chosen-1.1.0.js"></script>
<script src="deps/ldf-client-browser.js"></script>
<script src="ldf-client-jquery.js"></script>
<script src="ldf-client-jquery-url.js"></script>
<script>
jQuery(function ($) {
$('.ldf-client').queryui({ settings: 'queries.json' });
@@ -1,5 +1,5 @@
/*! @license ©2014 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */
/** Initializes the LDF client and its fragment and query picker. */
/** Loads and stores state of the Triple Pattern Fragments widget using the URL. */

jQuery(function ($) {
var $queryui = $('.ldf-client').one('changeQuerySet', function () {
@@ -1,5 +1,5 @@
/*! @license ©2015 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */
// jQuery widget for triple pattern fragments query execution
// jQuery widget for Triple Pattern Fragments query execution

(function ($) {
// Query UI main entry point, which mimics the jQuery UI widget interface:
File renamed without changes.
@@ -1,6 +1,6 @@
{
"scripts": {
"postinstall": "browserify browser -u stream -o deps/ldf-client-browser.js\ncd query-ui\n./build-all"
"postinstall": "browserify browser -u stream -o deps/ldf-client-browser.js\n./queries-to-json"
},
"dependencies": {
"ldf-client": "~1.3.0",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

This file was deleted.

This file was deleted.

@@ -34,5 +34,5 @@
"dbpprop": "http://dbpedia.org/property/",
"schema": "http://schema.org/"
},
"queries": "(Will be generated from the 'queries' folder by running the './build-queries' script.)"
"queries": "(Will be generated from the 'queries' folder by running the './queries-to-json' script.)"
}

0 comments on commit 1e63f07

Please sign in to comment.