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

dcat-merger

v1.4.1

Published

Merging several DCAT inputs into a single DCAT output.

Downloads

11

Readme

DCAT Merger

This Node.js package allows to merge the DCAT information of several sources into one single Turtle file. Below you can find a short summary of what happens under the hood.

  • We connect the existing datasets to the new catalog.
  • We create the necessary Catalog Records, between the catalog and the datasets.
  • We enhance the information of the datasets by using the available keywords and descriptions together with named entity recognition (NER). NER is facilitated through DBpedia Spotlight.
  • We expand the information provided by DBpedia spotlight by querying DBpedia itself. This is done using Linked Data Fragments (via http://fragments.dbpedia.org/2014/en).

Installation

  • Install Node.js
  • Clone this repo
  • Navigate to the folder of the repo
  • Execute npm install . -g

Usage

Create a config.json with the sources you want to merge. An example config.json can be found in the repo. For every source you need to provide the name and the url or file. You want to choose the option 'file' if you want to read a local Turtle file. Here, you can also set the DBpedia spotlight instances you want to use for NER. By default the use of NER is disabled, however, you can enable it by adding "useNER" : true to your config.json. In the folder data you can find some example Turtle files.

Stand Alone Application

  • Execute dcat-merger [OPTION]....

Output control

  • -v, --verbose: verbose
  • -c, --config : config file, if not specified the program will look for 'config.json' in the current directory.
  • -o, --output : output file, if no output file is specified output is redirect to stdout.
  • -t, --theme : config file for the themeMatcher, if not specified the default one will be used.
  • -s, --spatial: config file for the spatialDetector, if not specified the default one will be used.
  • -h, --help : show help
  • --version: show version information

Node.js Module

You can also use the module via

var dcatMerger = require('dcat-merger');

//here you can choose your own custom 'helpers'
//or the ones that came with this package, those can be found 
//in the 'lib' folder
//for this examples we use the ones from this package

var spatialDetector = require('../lib/spatialDetector.js');
var themeMatcher = require('../lib/themeMatcher.js');

//you also need to call some methods before they are ready for use
//ttl is a string containing all the triples in Turtle format,
//example in 'resources' folder
themeMatcher.setMappingTriples(ttl);

//spatialFile is a json file, example in  'resources' folder
spatialDetector.setConfig(require(spatialFile));

//you also need to set the config, example in config.json
dcatMerger.setConfig(getConfigFromFile());
dcatMerger.setThemeMatcher(themeMatcher);
dcatMerger.setSpatialDetector(spatialDetector);

dcatMerger.merge().then(function(triples){
	console.log(triples);
});	

The variable triples is an array containing objects with the following elements: subject, predicate, object and graph (= one triple).

Remarks

  • To match the different concepts from DBpedia with those from the TDT/dcat taxonomy, we created a basic mapping between the two. Replacing themeMatcher.js with a custom implementation allows to inject your own dynamic/static mapping.
  • To define the spatial property of a dataset, we created a spatialDetector.js. Based on the found resources (using NER), we determine if the resources point to a place/location etc. If you want to determine which types of classes are recognised as spatial, you can edit resources/spatialConfig.js (if you run it in a Node.js Application).
  • Tested on Ubuntu 14.04.

License

MIT licensed

Authors: