npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@p2m2/discovery

v0.4.3

Published

Ease Sparql request to reach semantic database.

Downloads

37

Readme

Discovery

p2m2 codecov CodeFactor Codacy Badge javadoc Npm package version Docker Image Version (tag latest semver) Maven Central

What is discovery

discovery is a software library which aims to ease the development of decision support tools exploiting omics RDF databases. The library offers a dedicated query language that can be used in several runtime environments (Browser/JS, Node/JS, JVM/Scala).

discovery is developed as part of the work package "Creating FAIR e-resources for knowledge mining" for the national infrastructure for metabolomics and fluxomics - MetaboHUB

features

  • Programming/building request with immutables objects
  • Querying several RDF content (SPARQL Endpoint, RDF File, RDF content)
  • Federated Query
  • Handling lazy page results
  • Subscribe to SPARQL query status events
  • Stringify request and configuration to ease transport
  • Decorating the building nodes with additional information

Dependencies - RDF Software libraries

this software development is based on RDFJS (RDF JavaScript Libraries) and RDF4J

Documentation

further information and documentation, visit https://p2m2.github.io/discovery/

Html/Js example

Html import

<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/p2m2/discovery@develop/dist/discovery-web.min.js"> </script> 
<script>
      var config = SWDiscoveryConfiguration
                    .init()
                    .sparqlEndpoint("https://metabolights.semantic-metabolomics.fr/sparql");

      SWDiscovery(config)
          .prefix("obo","http://purl.obolibrary.org/obo/")
          .prefix("metabolights","https://www.ebi.ac.uk/metabolights/property#")
          .prefix("rdfs","http://www.w3.org/2000/01/rdf-schema#")
          .something()
            .set(URI("obo:CHEBI_4167"))
              .isObjectOf(URI("metabolights:Xref"),"study")
                .datatype(URI("rdfs:label"),"label")
          .select("study","label")
             .commit()
             .raw()
             .then((response) => {
                  for (let i=0;i<response.results.bindings.length;i++) {
                    let study=response.results.bindings[i]["study"].value;
                    let label=response.results.datatypes["label"][study][0].value; 
                    console.log(study+"-->"+label);
                  }
            }).catch( (error) => {
              console.error(" -- catch exception --")
              console.error(error)
            } );
 </script>

js fiddle example

Install

sbt

libraryDependencies += "com.github.p2m2" %% "discovery" % "0.4.0"

scalajs

libraryDependencies += "com.github.p2m2" %%% "discovery" % "0.4.0"

npm

npm i @p2m2/discovery

Running docker proxy image

docker command

docker run -d --network host -t inraep2m2/service-discovery-proxy:latest

docker-compose file

version: '3.9'
services:
  service-discovery-proxy:
    image: inraep2m2/service-discovery-proxy:latest
    command: ./mill -w app.runBackground --port 8085 --verbose
    network_mode: "host"
    restart: on-failure