Code Monkey home page Code Monkey logo

semantic-dependencies's Introduction

Semantic Dependencies

npm version

This tool converts the node_modules dependencies of an npm project to RDF. Currently this is done by parsing the output of the npm ls command, while in the future we also want to be able to simply parse a given node_modules folder.

Note that this is not the same as the dependencies that can be found in a package.json file! The output will contain the actually installed versions, not the semantic ranges.

Sample output when this is executed on its own folder:

@prefix doap: <http://usefulinc.com/ns/doap#>.
@prefix npm: <https://linkedsoftwaredependencies.org/vocabularies/npm#>.
@prefix doc: <https://www.w3.org/2000/10/swap/pim/doc#>.

<#software> npm:engine <https://linkedsoftwaredependencies.org/engines/node/v6.5.0>, <https://linkedsoftwaredependencies.org/bundles/npm/3.10.3>;
    doap:name "node-dependency-parser";
    doap:revision "0.1.1".
<https://linkedsoftwaredependencies.org/bundles/npm/minimist/1.2.0> doap:revision "1.2.0";
    doap:name "minimist".
<#software> doc:dependsOn <https://linkedsoftwaredependencies.org/bundles/npm/minimist/1.2.0>.
<https://linkedsoftwaredependencies.org/bundles/npm/minimist/1.2.0> doap:file-release <https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz>.
<https://linkedsoftwaredependencies.org/bundles/npm/n3/0.10.0> doap:revision "0.10.0";
    doap:name "n3".
<#software> doc:dependsOn <https://linkedsoftwaredependencies.org/bundles/npm/n3/0.10.0>.
<https://linkedsoftwaredependencies.org/bundles/npm/n3/0.10.0> doap:file-release <https://registry.npmjs.org/n3/-/n3-0.10.0.tgz>.
<https://linkedsoftwaredependencies.org/bundles/npm/valid-url/1.0.9> doap:revision "1.0.9";
    doap:name "valid-url".
<#software> doc:dependsOn <https://linkedsoftwaredependencies.org/bundles/npm/valid-url/1.0.9>.
<https://linkedsoftwaredependencies.org/bundles/npm/valid-url/1.0.9> doap:file-release <https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz>.

This output shows the packages that were installed for this package when this was executed.

Install

This package can be installed via npm.

$ npm install -g semantic-dependencies

Usage

semantic-dependencies [-r root] [-f format] FOLDER
  -r root   : URI to use for the root module.
  -f format : Output format, see below for a full list of supported formats
format: text/turtle, application/n-triples, etc. (all those supported by N3.js)

FOLDER needs to be the root folder of the project. -r is for changing the root URI that needs to be used for this project. The default is #software.

License

This software is written by Joachim Van Herwegen.

This code is released under the MIT license.

semantic-dependencies's People

Contributors

rubensworks avatar joachimvh avatar

Stargazers

Andreas Kuckartz avatar  avatar Sarven Capadisli avatar

Watchers

 avatar James Cloos avatar  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.