Code Monkey home page Code Monkey logo

into-the-graph's Introduction

๐Ÿงญ Lightweight linked data browser

Deploy to GitHub Pages CodeQL analysis

Lightweight and fast RDF browser that just need a SPARQL endpoint URL to give a comfortable experience when exploring differents graphs.

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

See an example deployment of into-the graph at https://maastrichtu-ids.github.io/into-the-graph.

This RDF linked data browser features:

  • A web-based UI to browse SPARQL endpoints content easily. Stateful URL to resolve a specific URI in a specific SPARQL endpoint can be defined using the uri and endpoint parameters. Tested with RDF4J (Ontotext GraphDB) and Virtuoso SPARQL endpoints.
  • Easily search for concepts in the triplestore. Possibility to change the SPARQL query to define the custom query to use the Search index of different triplestores in settings (Ontotext GraphDB and Virtuoso triplestores documented).
  • Work in progress: insights about the content of the triplestore and its different graphs, using precomputed HCLS descriptives statistics.

HCLS descriptive statistics for a graph can simply be computed and inserted running a docker run command. Follow those instructions to run it. Or check the fair-metadata Python library in development.

Into-the-graph is built with TypeScript , 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

๐Ÿ‘จโ€๐Ÿ’ป Contribute

Contributions are welcome! See the guidelines to contribute.

๐ŸŽฌ Into-the-graph in action

โš ๏ธ Trying to query a HTTP SPARQL endpoint from into-the-graph which is provided through HTTPS might cause issues.

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

You can even directly use http://maastrichtu-ids.github.io/into-the-graph to browse a locally deployed endpoint! e.g. http://localhost:8890/sparql

๐Ÿ—๏ธ Run in development

Requirements: npm and yarn installed.

Clone the repository:

git clone https://github.com/MaastrichtU-IDS/into-the-graph
cd into-the-graph

Install dependencies ๐Ÿ“ฅ

yarn

Run the web app in development at http://localhost:19006

yarn dev

The website should reload automatically at each changes to the code ๐Ÿ”ƒ

Upgrade the packages versions in yarn.lock

yarn upgrade perfect-graph unitx-ui unitx

๐Ÿš€ Run in production

This website is automatically deployed by a GitHub Actions worklow to GitHub Pages at https://maastrichtu-ids.github.io/into-the-graph

You can build locally in /web-build folder and serve on http://localhost:5000 ๐Ÿ“ฆ

yarn build
yarn serve

Or run directly using Docker ๐Ÿณ (requires docker installed)

docker-compose up

Checkout the docker-compose.yml file to see how we run the Docker image.

๐Ÿ”Ž Search queries

Optimized SPARQL query to perform full text search in 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).

into-the-graph's People

Contributors

carlosug avatar vemonet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

into-the-graph's Issues

Using Graph not supported by Wikidata endpoint

into-the-graph fail querying Wikidata endpoint due to the GRAPH ?graph { part, not supported in Blazegraph triple mode.

See https://query.wikidata.org/sparql

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT * WHERE {
  graph ?g {
  <http://www.wikidata.org/entity/Q45> ?pred ?obj .
  } } LIMIT 10

Expore LDP Graphs

Virtuoso LDP generates a lots of graphs

See http://trek.semanticscience.org/describe?uri=http://w3id.org/FAIR_Training_LDP/DAV/home/LDP/Training/Murcia/marks_resource.ttl&endpoint=http://w3id.org/FAIR_COVID19/sparql/

A good way to navigate LDP for this use-case:

PREFIX ldp: <http://www.w3.org/ns/ldp#> 
PREFIX schema: <http://schema.org/> 
SELECT ?crateContainer WHERE { 
  GRAPH ?crateContainer { 
    ?crateContainer ldp:contains ?crate .
  } 
  GRAPH ?crate { ?s schema:studyDesign "Cohort" .} 
}

Should we have a switch to allow to get all triples in graphs instead of just classes?

Add admin page

With lock icon in navbar and password access

Allow to change:

  • SPARQL endpoint URL
  • SPARQL query for full text search
  • Prefix/namespaces defined. The use can choose between:
    • directly add in the file (easy to implement)
    • use a central service, such as PrefixCommons (to implement later)

Those variables are stored in the React Context API store

Properly exchange data between components

Tutorial to use the new React Context API store: https://www.toptal.com/react/react-context-api

Most complete tutorial, with all solutions (classic, redux, context API): https://towardsdatascience.com/passing-data-between-react-components-parent-children-siblings-a64f89e24ecf

Clean tutorial without using Redux: https://medium.com/@ruthmpardee/passing-data-between-react-components-103ad82ebd17

Fix issue with describe not reloading when URI param changes at the same time

Improve display to change SPARQL endpoint

This was a easy way to fix it, but could be improved later

I was thinking about putting the current SPARQL endpoint on the top navbar right

Hum, and a Autocomplete directly at this place
So the top bar would be:

  • which URI you describe
  • In which SPARQL endpoint

If it is too packed, I can just put under the URI in current UI

And add the dropdown for graph query in graph overview?

It will be better to refactor a bit to define a specific component for our different Autocomplete

Better SPARQL: improve resolution of graphs URI

At the moment we try to get only the classes of the graph

A few issues when resolving a graph URI:

  • Not all classes are always retrieved on big graph: the query needs to be optimized. But this kind of query can be quite expensive to run, so we are using limit at the moment
  • If the graph has no classes then the UI shows nothing (add fallback query which get any statement?)

Switch to typescript

Fix npm install warnings

All comes from dependencies

npm WARN deprecated [email protected]: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated [email protected]: Way too old
npm WARN deprecated [email protected]: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated [email protected]: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

Improve the Search feature

See the search query

  • At the moment we only do a simple search via SPARQL using contains on label, but still really slow for big datasets such as ncats-red-kg
  • A customize search query have been written for GraphDB using its homemade search index
  • Virtuoso and Blazegraph also allows to index statements

We should be able to easily switch from a search query to another, through an Admin UI?
See #8

Alternatives Linked Data browsers

LODEstar

GitHub

SPARQL query and URI resolution, available through DockerHub.

docker run --rm -d --name lodestar -p 8082:8080 \
  -e ENDPOINT_URL=https://graphdb.dumontierlab.com/repositories/ncats-red-kg \
  -e TOP_RELATIONSHIP=http://w3id.org/biolink/vocab/id,http://w3id.org/biolink/vocab/name,http://w3id.org/biolink/vocab/description \
  -e LABEL=http://w3id.org/biolink/vocab/label \
  -e DESCRIPTION=http://w3id.org/biolink/vocab/description \
  -e MAX_OBJECTS=10 \
  -e SERVICE_BASE_URI=http://localhost:8080/ncats-red-kg netresearch/lodestar

Access at http://localhost:8082/lodestar/sparql

Does not support graphs ๐Ÿšซ

Trifid

GitHub

Linked Data Server: URI dereferencing, custom HTML render, YASGUI SPARQL endpoint.

git clone https://github.com/vemonet/trifid.git
docker build -t trifid ./trifid

docker run --rm -ti --name trifid -p 8080:8080 trifid --sparql-endpoint-url=https://graphdb.dumontierlab.com/repositories/test --dataset-base-url=https://w3id.org/d2s/

docker run --rm -ti --name trifid -v /home/vemonet/sandbox/trifid:/data -p 8080:8080 trifid --config=/data/config-ncats-red-kg.json

Go to http://localhost:8080/dataset/huri/ to resolve https://w3id.org/d2s/dataset/huri/

Modified version on GitHub.

Original project available on DockerHub. But config not working.

docker run -ti -p 8080:8080 zazuko/trifid
# Not working, provide env config file?
docker run -ti -p 8080:8080 -e TRIFID_CONFIG=config-ncats-red-kg.json zazuko/trifid
docker run -ti -p 8080:8080 -e SPARQL_ENDPOINT_URL=https://graphdb.dumontierlab.com/repositories/test -e DATASET_BASE_URL=https://w3id.org/d2s/ zazuko/trifid

Access default example on http://localhost:8080/data/person/mary-cooper to resolve URI.

Does not support graphs ๐Ÿšซ

brwsr

GitHub

Lightweight Linked Data Browser.

git clone https://github.com/Data2Semantics/brwsr.git
docker-compose up

Go to http://localhost:5000.

Change the SPARQL endpoint in the docker-compose.yml.

Does not support graphs ๐Ÿšซ

RhizomerEye

RhizomerEye is a tool to expose a SPARQL endpoint as REST API and deploy a Web UI to browse the triplestore.

See the source code for the RhizomerAPI and RhizomerEye.

The Web UI has been deployed publicly for a few triplestores:

TriplyDB

See official documentation. It allows to deploy the following services over a triplestore:

TriplyDB is hosted centrally and cannot be deployed locally ๐Ÿšซ

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.