Giter Club home page Giter Club logo

searchbee's Introduction

๐Ÿ Searchbee

This library and command line interface (CLI) start a server that offers a search API on top of knowledge graphs.

A lot of knowledge graph are hosted on the Web where IRIs are used to uniquely identify resources. In certain use cases when looking for the IRI of a specific resource users want to search for it based on its label or description. This library and CLI offer such a search functionality on top of these knowledge graphs. It starts a server that accepts a single GET request with the searched term.

Usage

  1. Install Searchbee via npm -g i searchbee.
  2. Either start a server or generate an index.

Start server

  1. Execute Searchbee via searchbee server -s [sources] where sources is a comma-separated list of sources, such as TPF servers, RDF files, and SPARQL endpoints.
  2. Search for the resources via curl http://localhost:8080/?q=[term] where term is the search term. The output is a JSON array with the IRIs of the matched resources.

The search index is by default build based on the triples with predicate http://www.w3.org/2000/01/rdf-schema#label. This is overwritten through the option -l, --label. The search index considers by default all resources that are found. This is overwritten through the option --resources. In this case the index only considers the resources that match the sources. For example, if your sources are http://example.org/A and http://example.org/B, then the index is built only with triples about these two resources. Even if the sources return for example triples about http://example.org/C.

Example

  1. searchbee server -s https://ruben.verborgh.org/profile/#me starts a server based on the data at https://ruben.verborgh.org/profile/#me.
  2. curl http://localhost:8080/?q=ruben searches for resources mentioning "ruben".

Generate index

By generating an index before staring the server allows you to reuse the index when restarting the server. This removes the need to create the index every time you start the server, which might be time-consuming for big sources.

  1. Execute Searchbee via searchbee index -s [sources] -f [path] where sources is a comma-separated list of sources, such as TPF servers, RDF files, and SPARQL endpoints, and path points to the file that stores the index.

  2. Execute Searchbee via searchbee server -f [path] where path points to the file that stores the index.

Example

  1. searchbee index -s https://ruben.verborgh.org/profile/#me -f index.json generates an index based on the data at https://ruben.verborgh.org/profile/#me and stores in the file index.json.
  2. searchbee server -f index.json starts a server based on the index in index.json.

Development

  1. Install dependencies via npm i.
  2. Make changes.
  3. Execute Searchbee via node ./bin/cli.js.

Documentation

We use Vale to lint the documentation.

  1. Install Vale.
  2. Execute npm run lint:docs to lint the documentation.

License

ยฉ 2020 Pieter Heyvaert, MIT License

searchbee's People

Contributors

pheyvaer avatar

Stargazers

Patrick Hochstenbach avatar Kush Bisen avatar Yuyuan avatar Daniel Beeke avatar  avatar  avatar Elias K. avatar Cristian Vasquez avatar

Watchers

Bob Coret avatar James Cloos avatar  avatar

searchbee's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.