Coder Social home page Coder Social logo

00mjk / into-the-graph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maastrichtu-ids/into-the-graph

0.0 0.0 0.0 49.27 MB

๐Ÿงญ Resolve, visualize and browse the content of any SPARQL endpoint

Home Page: https://maastrichtu-ids.github.io/into-the-graph

License: MIT License

Dockerfile 0.62% HTML 1.51% JavaScript 96.39% Shell 0.19% SCSS 1.28%

into-the-graph's Introduction

Lightweight linked data browser

The motivation behind this linked data browser was to provide a fast RDF browser that just need a SPARQL endpoint URL to give a comfortable experience when exploring differents triplestores.

This browser supports graphs natively (n-quads), which most RDF linked data browser don't at the moment, this gives a net gain of 33% of informations for each statement! ๐Ÿ“ˆ

Browse a RDF triplestore by providing the SPARQL endpoint URL directly in the browser.

See an example deployment of into-the graph at trek.semanticscience.org. Settings can be easily changed to browse various triplestores.

This RDF linked data browser features:

HCLS descriptive statistics for a graph can simply be computed and inserted running a docker run command. Follow those instructions to run it.

Into-the-graph is built with ReactJS and Material-UI to serve and explore RDF data from any SPARQL endpoint.

This service has been developed and used as part of the Data2Services framework. Data2Services provides tools and guideline to easily integrate multiple structured data sources (CSV, RDB, XML) to a RDF knowledge graph, complying with a defined data model. Checkout the documentation at d2s.semanticscience.org

Into-the-graph in action ๐ŸŽฌ

Start browsing various SPARQL endpoints using into-the-graph in one click:

You will need to go to settings to change the SPARQL endpoint URL permanently.

You can even directly use trek.semanticscience.org to browse a locally deployed endpoint! e.g. http://localhost:8890/sparql

Development ๐Ÿšง

To run into-the-graph for development, the deployed website will be automatically updated at each change to the code.

Install dependencies ๐Ÿ“ฅ

Install all required dependencies locally:

yarn install

Add a package to the dev environment only:

yarn add my-package --dev

Upgrade all installed packages:

yarn upgrade --latest

Start the development server ๐Ÿ‘จโ€๐Ÿ’ป

yarn dev

Access on http://localhost:19006

Deploy in production ๐Ÿš€

We use Docker to deploy into-the-graph in production.

Use the DockerHub image ๐Ÿณ

You can use the prebuilt image available on DockerHub.

Pull the image:

docker pull umids/into-the-graph

Run the image:

docker run --rm -it -p 8082:5000 umids/into-the-graph

Access on http://localhost:8082/

Build the image locally ๐Ÿ“ฆ

Or build it locally, various parameters can be changed before build in settings.json.

docker build -t umids/into-the-graph .

Then run it the same way as for the DockerHub build.

Settings details ๐Ÿ“

Details about some of the parameters that can be changed in settings:

  • sparql_endpoint: the SPARQL endpoint to browse

  • comunica_url: Comunica widget URL that will be displayed as an iFrame in the Comunica page

  • search_query: the SPARQL query used when doing a search (allow to define SPARQL query using custom search indexes)

    • The SPARQL query should return ?foundUri and ?foundLabel as results of the search
    • Use $TEXT_TO_SEARCH to define the emplacement for the search text in the query

The following parameters can be changed in settings.json:

  • prefixes: dictionary of prefixes and the corresponding namespaces used to resolve URIs in the web UI

  • default_search_query: the SPARQL query used when doing a search if an empty string has been passed to the uri param (allow to show some concepts in the triplestore by default)

  • The SPARQL query should return ?foundUri and ?foundLabel as results of the search

    • Use $TEXT_TO_SEARCH to define the emplacement for the search text in the query

TODO: pass settings.json at runtime

# Something like
docker run -v $(pwd)/settings.json:/usr/share/nginx/html/settings.json --rm -it -p 8082:80 into-the-graph

Restart script โ™ป๏ธ

Convenience script to git pull, docker build and restart docker.

./restart_docker.sh

Access at http://localhost:8082

Search queries ๐Ÿ”Ž

Optimized search query for different triplestores.

Generic

Support the BioLink model (get rdfs:label and bl:name)

SELECT ?foundUri ?foundLabel WHERE {?foundUri ?p ?foundLabel . VALUES ?p {<http://www.w3.org/2000/01/rdf-schema#label> <https://w3id.org/biolink/vocab/name>} . FILTER(isLiteral(?foundLabel)) FILTER contains(?foundLabel, '$TEXT_TO_SEARCH')} LIMIT 5

GraphDB

See GraphDB full text search documentation to create a search index (uses Apache Lucene under the hood).

PREFIX luc: <http://www.ontotext.com/owlim/lucene#> SELECT ?foundUri ?foundLabel { ?foundLabel luc:searchIndex '$TEXT_TO_SEARCH*' . ?foundUri ?p ?foundLabel . } LIMIT 100

Order by Lucene score

PREFIX luc: <http://www.ontotext.com/owlim/lucene#> SELECT ?foundUri ?foundLabel { ?foundLabel luc:searchIndex '$TEXT_TO_SEARCH*' ; luc:score ?score . ?foundUri ?p ?foundLabel . } ORDER BY ?score LIMIT 100

DBpedia Virtuoso

SELECT ?foundUri ?foundLabel WHERE {?foundUri <http://www.w3.org/2000/01/rdf-schema#label> ?foundLabel . ?foundLabel bif:contains '$TEXT_TO_SEARCH' . } LIMIT 200

OpenCitation

SELECT ?foundUri ?foundLabel WHERE {?foundUri ?p ?foundLabel . VALUES ?p {<http://purl.org/spar/cito/hasCitationCreationDate> <http://purl.org/spar/cito/hasCitationTimeSpan>} . FILTER(str(?foundLabel) =  '$TEXT_TO_SEARCH')} LIMIT 5

Text operations really slow on OpenCitation SPARQL, so we do a full match (for date mainly).

Publish using Expo (experimental) ๐Ÿงช

Experimental feature, only try it if you know what you are doing!

Install expo-cli

npm install -g expo-cli

See GitHub repository and documentation to build standalone app.

Using bycedric/expo-cli Docker image. On Docker: use yarn start to build using serve

First you need to have your app built in the web-build folder.

# To remove:
docker run --tty --interactive \
    --workdir /srv \
    --volume $HOME/into-the-graph:/srv \
    --env EXPO_CLI_USERNAME=vemonet \
    --env EXPO_CLI_PASSWORD=password \
    bycedric/expo-cli publish

Don't forget to change the path to the git repository ($HOME at the moment).

into-the-graph's People

Contributors

carlosug avatar vemonet avatar

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.