Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rdf2hk

Package Overview
Dependencies
Maintainers
5
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rdf2hk

This library converts RDF to Hyperknowledge Description

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

rdf2hk

This library contains classes and functions to convert RDF model to the Hyperknowledge model

Install

npm install rdf2hk

Usage

const RDF2HK = require("rdf2hk");

RDF to Hyperknowledge

Example:


const GraphFactory = RDF2HK.GraphFactory;

const mimeType = "application/turtle" // application/json | application/n-triples | application/n-quads | application/trig | application/turtle | application/rdf+xml
GraphFactory.parseGraph(inputData, mimeType, (err, graph) =>
{
	if(err)
	{
		console.error(err);
		return;
	}

	let hkentities = RDF2HK.Parser.parseGraph(graph);

	console.log(hkentities); // print the converted entities

	// <...>
}); 

Hyperknowledge to RDF

Example:

const GraphFactory = RDF2HK.GraphFactory;

const mimeType = "application/turtle" // application/json | application/n-triples | application/n-quads | application/trig | application/turtle | application/rdf+xml

let graph = GraphFactory.createGraph(mimeType);
    
Serializer.serialize(hkentities, {}, graph); // options: see api reference

GraphFactory.serializeGraph(graph, (err, data) =>
{
	if(!err)
	{
		// Print the rdf serialized data
		console.log(data);

		// <...>
	}
	else
	{
		console.error(err);
	}

});

Keywords

FAQs

Package last updated on 29 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc