Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Fast, tiny, pure-js canonical n-quads & n-triples parser

NotificationsYou must be signed in to change notification settings

ontola/n-quads-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a basic, but fast pure-js n-quads/triples parser. It has no dependencies to node and can berun in the browser.

Installation

yarn add n-quads-parser @ontologies/core

npm i n-quads-parser @ontologies/core

Usage

This was written as a faster n-quads parser forlink-liband designed to work withrdflib.js.

The parser is already integrated into link-lib which can also consumelinked-delta payloads in addition to plain n-quads.

If you're looking for a quick and easy way to build linked-data based RDF applications, check outlink-redux.

Plain #"auto" data-snippet-clipboard-copy-content="import rdf from '@ontologies/core';// Can also be IndexedFormula from rdflib.js or RDFStore from link-lib.const store = { rdfFactory: rdf, quads: [], add(s, p, o, g) { this.quads.push(rdf.quad(s, p, o, g)); }}const parser = new NQuadsParser(store);fetch(url) .then((req) => req.text()) .then((body) => parser.loadBuf(body));// The quads should be loaded into the store.">

importrdffrom'@ontologies/core';// Can also be IndexedFormula from rdflib.js or RDFStore from link-lib.conststore={rdfFactory:rdf,quads:[],add(s,p,o,g){this.quads.push(rdf.quad(s,p,o,g));}}constparser=newNQuadsParser(store);fetch(url).then((req)=>req.text()).then((body)=>parser.loadBuf(body));// The quads should be loaded into the store.

TODO:

About

Fast, tiny, pure-js canonical n-quads & n-triples parser

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp