Socket
Book a DemoInstallSign in
Socket

rdf2hk

Package Overview
Dependencies
Maintainers
5
Versions
90
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.1
latest
Source
npmnpm
Version published
Weekly downloads
9
50%
Maintainers
5
Weekly downloads
 
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

hyperknowledge

FAQs

Package last updated on 14 Dec 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.