JS RDF store with SPARQL support

Overview

#rdfstore-js Build Status Join the chat at https://gitter.im/antoniogarrote/rdfstore-js

Important Note

Many features present in versions 0.8.X have been removed in the 0.9.X. Some of them, will be added in the next versions, other like the MongoDB backend will be discarded. Please read this README file carefully to find the current set of features.

Table of Contents

Introduction

rdfstore-js is a pure Javascript implementation of a RDF graph store with support for the SPARQL query and data manipulation language.

var rdfstore = require('rdfstore');

rdfstore.create(function(err, store) {
  store.execute('LOAD <http://dbpedia.org/resource/Tim_Berners-Lee> INTO GRAPH <http://example.org/people>', function() {

	store.setPrefix('dbp', 'http://dbpedia.org/resource/');

	store.node(store.rdf.resolve('dbp:Tim_Berners-Lee'),  "http://example.org/people", function(err, graph) {

	  var peopleGraph = graph.filter(store.rdf.filters.type(store.rdf.resolve("foaf:Person")));

	  store.execute('PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\
					 PREFIX foaf: <http://xmlns.com/foaf/0.1/>\
					 PREFIX : <http://example.org/>\
					 SELECT ?s FROM NAMED :people { GRAPH ?g { ?s rdf:type foaf:Person } }',
					 function(err, results) {

					   console.log(peopleGraph.toArray()[0].subject.valueOf() === results[0].s.value);

					 });
	});

  });
});

rdfstore-js can be executed in a web browser or can be included as a library in a node.js application. It can also be executed as a stand-alone SPARQL end-point accepting SPARQL RDF Protocol HTTP requests. Go to the bottom of this page to find some application examples using the library.

The current implementation is far from complete but it already passes all the test cases for the SPARQL 1.0 query language and supports data manipulation operations from the SPARQL 1.1/Update version of the language.

Some other features included in the library are the following:

  • SPARQL 1.0 support
  • SPARQL 1.1/Update support
  • Partial SPARQL 1.1 query support
  • JSON-LD parser
  • Turtle/N3 parser
  • W3C RDF Interfaces API
  • RDF graph events API
  • Custom filter functions
  • Browser persistence using IndexedDB

Documentation

Documentation for the store can be found here.

SPARQL support

rdfstore-js supports at the moment SPARQL 1.0 and most of SPARQL 1.1/Update. Only some parts of SPARQL 1.1 query have been implemented yet.

This is a list of the different kind of queries currently implemented:

  • SELECT queries
  • UNION, OPTIONAL clauses
  • NAMED GRAPH identifiers
  • LIMIT, OFFSET
  • ORDER BY clauses
  • SPARQL 1.0 filters and builtin functions
  • variable aliases
  • variable aggregation: MAX, MIN, COUNT, AVG, SUM functions
  • GROUP BY clauses
  • DISTINCT query modifier
  • CONSTRUCT queries
  • ASK queries
  • INSERT DATA queries
  • DELETE DATA queries
  • DELETE WHERE queries
  • WITH/DELETE/INSERT/WHERE queries
  • LOAD queries
  • CREATE GRAPH clauses
  • DROP DEFAULT/NAMED/ALL/GRAPH clauses
  • CLEAR DEFAULT/NAMED/ALL/Graph clauses
  • FILTER EXISTS / NOT EXISTS operators
  • BIND
  • FILTER IN / NOT IN operators

##Installation

The library can be installed using NPM:

$ npm install rdfstore

The library can also be installed via bower using a global module:

$ bower install rdfstore

##Building

Before running the build script, you must install JavaScript dependencies with npm (npm is shipped with node):

$ npm install

The library can be built using gulp:

$ gulp

The browser version can be built using the 'browser' gulp target:

$ gulp browser

Tests

To execute the whole test suite of the library, including the DAWG test cases for SPARQL 1.0 and the test cases for SPARQL 1.1 implemented at the moment, a gulp target can be executed:

$ gulp specs

Additionally, there are some smoke tests for both browser versions that can be found ithe 'spec/browser'' directory.

API

This is a small overview of the rdfstore-js API.

###Store creation

//nodejs only
var rdfstore = require('rdfstore');

// in the browser the rdfstore object
// is already defined

// alt 1
rdfstore.create(function(err, store) {
  // the new store is ready
});


// alt 2
new rdfstore.Store(function(err, store) {
  // the new store is ready
});

###Query execution

// simple query execution
store.execute("SELECT * { ?s ?p ?o }", function(err, results){
  if(!err) {
	// process results
	if(results[0].s.token === 'uri') {
	  console.log(results[0].s.value);
	}
  }
});

// execution with an explicit default and named graph

var defaultGraph = [{'token':'uri', 'value': graph1}, {'token':'uri', 'value': graph2}, ...];
var namedGraphs  = [{'token':'uri', 'value': graph3}, {'token':'uri', 'value': graph4}, ...];

store.executeWithEnvironment("SELECT * { ?s ?p ?o }",defaultGraph,
  namedGraphs, function(err, results) {
  if(err) {
	// process results
  }
});

###Construct queries RDF Interfaces API

var query = "CONSTRUCT { <http://example.org/people/Alice> ?p ?o } \
			 WHERE { <http://example.org/people/Alice> ?p ?o  }";

store.execute(query, function(err, graph){
  if(graph.some(store.rdf.filters.p(store.rdf.resolve('foaf:name')))) {
	nameTriples = graph.match(null,
							  store.rdf.createNamedNode(rdf.resolve('foaf:name')),
							  null);

	nameTriples.forEach(function(triple) {
	  console.log(triple.object.valueOf());
	});
  }
});

###Loading remote graphs

rdfstore-js will try to retrieve remote RDF resources across the network when a 'LOAD' SPARQL query is executed. The node.js build of the library will use regular TCP sockets and perform proper content negotiation. It will also follow a limited number of redirections. The browser build, will try to perform an AJAX request to retrieve the resource using the correct HTTP headers. Nevertheless, this implementation is subjected to the limitations of the Same Domain Policy implemented in current browsers that prevents cross domain requests. Redirections, even for the same domain, may also fail due to the browser removing the 'Accept' HTTP header of the original request. rdfstore-js relies in on the jQuery Javascript library to peform cross-browser AJAX requests. This library must be linked in order to exeucte 'LOAD' requests in the browser.

store.execute('LOAD <http://dbpedialite.org/titles/Lisp_%28programming_language%29>\
			   INTO GRAPH <lisp>', function(err){
  if(err) {
	var query = 'PREFIX foaf:<http://xmlns.com/foaf/0.1/> SELECT ?o \
				 FROM NAMED <lisp> { GRAPH <lisp> { ?s foaf:page ?o} }';
	store.execute(query, function(err, results) {
	  // process results
	});
  }
})

###High level interface

The following interface is a convenience API to work with Javascript code instead of using SPARQL query strings. It is built on top of the RDF Interfaces W3C API.

/* retrieving a whole graph as JS Interafce API graph object */

store.graph(graphUri, function(err, graph){
  // process graph
});


/* Exporting a graph to N3 (this function is not part of W3C's API)*/
store.graph(graphUri, function(err, graph){
  var serialized = graph.toNT();
});


/* retrieving a single node in the graph as a JS Interface API graph object */

store.node(subjectUri, function(err, node) {
  //process node
});

store.node(subjectUri, graphUri, function(err, node) {
  //process node
});



/* inserting a JS Interface API graph object into the store */

// inserted in the default graph
store.insert(graph, function(err) {}) ;

// inserted in graphUri
store.insert(graph, graphUri, function(err) {}) ;



/* deleting a JS Interface API graph object into the store */

// deleted from the default graph
store.delete(graph, function(err){});

// deleted from graphUri
store.delete(graph, graphUri, function(err){});



/* clearing a graph */

// clears the default graph
store.clear(function(err){});

// clears a named graph
store.clear(graphUri, function(err){});



/* Parsing and loading a graph */

// loading local data
store.load("text/turtle", turtleString, function(err, results) {});

// loading remote data
store.load('remote', remoteGraphUri, function(err, results) {});



/* Registering a parser for a new media type */

// The parser object must implement a 'parse' function
// accepting the data to parse and a callback function.

store.registerParser("application/rdf+xml", rdXmlParser);

###RDF Interface API

The store object includes a 'rdf' object implementing a RDF environment as described in the RDF Interfaces 1.0 W3C's working draft. This object can be used to access to the full RDF Interfaces 1.0 API.

var graph = store.rdf.createGraph();
graph.addAction(rdf.createAction(store.rdf.filters.p(store.rdf.resolve("foaf:name")),
								 function(triple){ var name = triple.object.valueOf();
												   var name = name.slice(0,1).toUpperCase()
												   + name.slice(1, name.length);
												   triple.object = store.rdf.createNamedNode(name);
												   return triple;}));

store.rdf.setPrefix("ex", "http://example.org/people/");
graph.add(store.rdf.createTriple( store.rdf.createNamedNode(store.rdf.resolve("ex:Alice")),
								  store.rdf.createNamedNode(store.rdf.resolve("foaf:name")),
								  store.rdf.createLiteral("alice") ));

var triples = graph.match(null, store.rdf.createNamedNode(store.rdf.resolve("foaf:name")), null).toArray();

console.log("worked? "+(triples[0].object.valueOf() === 'Alice'));

###Default Prefixes

Default RDF name-spaces can be specified using the registerDefaultNamespace. These names will be included automatically in all queries. If the same name-space is specified by the client in the query string the new prefix will shadow the default one. A collection of common name-spaces like rdf, rdfs, foaf, etc. can be automatically registered using the registerDefaultProfileNamespace function.

new Store({name:'test', overwrite:true}, function(err,store){
	store.execute('INSERT DATA {  <http://example/person1> <http://xmlns.com/foaf/0.1/name> "Celia" }', function(err){

	   store.registerDefaultProfileNamespaces();

	   store.execute('SELECT * { ?s foaf:name ?name }', function(err,results) {
		   test.ok(results.length === 1);
		   test.ok(results[0].name.value === "Celia");
	   });
	});
});

###JSON-LD Support

rdfstore-js implements parsers for Turtle and JSON-LD. The specification of JSON-LD is still an ongoing effort. You may expect to find some inconsistencies between this implementation and the actual specification.

		jsonld = {
		  "@context":
		  {
			 "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
			 "xsd": "http://www.w3.org/2001/XMLSchema#",
			 "name": "http://xmlns.com/foaf/0.1/name",
			 "age": {"@id": "http://xmlns.com/foaf/0.1/age", "@type": "xsd:integer" },
			 "homepage": {"@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "xsd:anyURI" },
			 "ex": "http://example.org/people/"
		  },
		  "@id": "ex:john_smith",
		  "name": "John Smith",
		  "age": "41",
		  "homepage": "http://example.org/home/"
		};

store.setPrefix("ex", "http://example.org/people/");

store.load("application/ld+json", jsonld, "ex:test", function(err,results) {
  store.node("ex:john_smith", "ex:test", function(err, graph) {
	// process graph here
  });
});

###Events API

rdfstore-js implements an experimental events API that allows clients to observe changes in the RDF graph and receive notifications when parts of this graph changes. The two main event functions are subscribe that makes possible to set up a callback function that will be invoked each time triples matching a certain pattern passed as an argument are added or removed, and the function startObservingNode that will be invoked with the modified version of the node each time triples are added or removed from the node.

var cb = function(event, triples){
  // it will receive a notifications where a triple matching
  // the pattern s:http://example/boogk, p:*, o:*, g:*
  // is inserted or removed.
  if(event === 'added') {
	console.log(triples.length+" triples have been added");
  } else if(event === 'deleted') {
	console.log(triples.length+" triples have been deleted");
  }
}

store.subscribe("http://example/book",null,null,null,cb);


// .. do something;

// stop receiving notifications
store.unsubscribe(cb);

The main difference between both methods is that subscribe receives the triples that have changed meanwhile startObservingNode receives alway the whole node with its updated triples. startObservingNode receives the node as a RDF Interface graph object.

var cb = function(node){
  // it will receive the updated version of the node each
  // time it is modified.
  // If the node does not exist, the graph received will
  // not contain triples.
  console.log("The node has now "+node.toArray().length+" nodes");
}

// if only tow arguments are passed, the default graph will be used.
// A graph uri can be passed as an optional second argument.
store.startObservingNode("http://example/book",cb);


// .. do something;

// stop receiving notifications
store.stopObservingNode(cb);

In the same way, there are startObservingQuery and stopObservingQuery functions that makes possible to set up callbacks for whole SPARQL queries. The store will try to be smart and not perform unnecessary evaluations of these query after quad insertion/deletions. Nevertheless too broad queries must be used carefully with the events API.

###Custom Filter Functions

Custom filter function can be registered into the store using the registerCustomFunction function. This function receives two argument, the name of the custom function and the associated implementation. This functions will be available in a SPARQL query using the prefix custom. You can also use a full URI to identify the function that is going to be registered. The function implementation will receive two arguments, an object linking to the store query filters engine and a list with the actual arguments. Arguments will consist of literal or URIs objects. Results from the function must also be literal or URI objects.

The query filters engine can be used to access auxiliary function to transform literals into JavaScript types using the effectiveTypeValue function, boolean values using the effectiveBooleanValue, to build boolean literal objects (ebvTrue, ebvFalse) or return an error with the ebvError. Documentation and source code for the QueryFilters object n the 'js-query-engine' module can be consulted to find information about additional helper functions.

The following test shows a simple examples of how custom functions can be invoked:

new Store({name:'test', overwrite:true}, function(err,store) {
	store.load(
		'text/n3',
		'@prefix test: <http://test.com/> .\
		 test:A test:prop 5.\
		 test:B test:prop 4.\
		 test:C test:prop 1.\
		 test:D test:prop 3.',
		function(err) {

			var invoked = false;
            // instead of 'my_addition_check' a full URI can be used 'http://test.com/my_fns/my_addition_check'
			store.registerCustomFunction('my_addition_check', function(engine,args) {
		// equivalent to var v1 = parseInt(args[0].value), v2 = parseInt(args[1].value);

		var v1 = engine.effectiveTypeValue(args[0]);
		var v2 = engine.effectiveTypeValue(args[1]);

		// equivalent to return {token: 'literal', type:"http://www.w3.org/2001/XMLSchema#boolean", value:(v1+v2<5)};

		return engine.ebvBoolean(v1+v2<5);
	});

	   store.execute(
				'PREFIX test: <http://test.com/> \
				 SELECT * { ?x test:prop ?v1 .\
							?y test:prop ?v2 .\
							filter(custom:my_addition_check(?v1,?v2)) }',
				function(err) {
				   test.ok(results.length === 3);
		   for(var i=0; i<results.length; i++) {
			test.ok(parseInt(results[i].v1.value) + parseInt(results[i].v2.value) < 5 );
		}
		test.done()
		}
	);
  });
});

###Persistence

The store can be persisted in the browser using IndexedDB as the backend. In order to make the store persistent, the 'persistent' flag must be set to true in the store creation options. Additionally, a 'name' option can also be passed for the store. Different persistent instances of the store can be opened using different names.

###Controlling the frequency of function yielding

Performance of the store can be improved by reducing the frequency the 'nexTick' mechanism is used to cancel the the calls stack. You can reduce this frequency by invoking the yieldFrequency function on the Store object and passing a bigger number:

var rdfstore = require('rdfstore')
rdfstore.Store.yieldFrequency(200); // will only yield after 200 invocations of nextTick

If the number is too big a number can produce stack overflow errors during execution. If you find this problem, reduce the value provided for yieldFrequency.

##Dependencies

The library include dependencies to two semantic-web libraries for parsing:

  • N3.js library, developed by Ruben Verborgh and released under the MIT license.

  • jsonld, developed by Digital Bazaar and released under the New BSD license.

##Frontend

A stand-along frontend for the store built using electron has been added in version 0.9.7. You can build the frontend running the command:

$ gulp frontend

The file will be added under the releases directory.

##Contributing

rdfstore-js is still at the beginning of its development. If you take a look at the library and find a way to improve it, please ping us. We'll be very greatful for any bug report or pull-request.

Author

Antonio Garrote, email:[email protected], twitter:@antoniogarrote.

License

Licensed under the MIT License, copyright Antonio Garrote 2011-2015

Comments
  • If this project is dead, what's the alternative?

    If this project is dead, what's the alternative?

    I suppose other rdfstore-js users are wondering about this as I am.

    I'm working on a project that requires an RDF store in the browser, I chose rdfstore-js as it seemed superior to the other options I checked (and there weren't many). So, above all: Thanks @antoniogarrote for building this! It's great, and, of course, it has its problems and bugs, but the most important problem is: it's abandoned.

    • @antoniogarrote - you are working on the 1.1 branch, but I don't see any documentation to help me figure out if I can use that code. Where is it going? Will it eventually replace the abandoned version in the master branch?
    • To those currently working on forks and waiting on pull requests (@trueg, @juniperchicago, @bensinober, @RubenVerborgh, @jandrieu... ) - Is any of you planning to continue working on rdfstore-js in the near future? Could we find some way of collaborating to get this code to work the way we need it? Maybe you want to share what your modifications were about? Maybe we could find a way to combine the forks into one we continue to maintain? It seems to me that the potential for continuing is there - or am I missing something?
    • If we have to give up on rdfstore-js: which RDF store would you recommend for use in the browser?
    opened by fkleedorfer 31
  • Integrate N3.js (node-n3) parser directly with rdfstore-js

    Integrate N3.js (node-n3) parser directly with rdfstore-js

    Currently, N3.js (node-n3) has been added to rdfstore-js in an ad-hoc way. Unfortunately, this means that it is difficult to update the version; witnessed by the fact that it is seriously outdated at this moment. rdfstore-js still uses the instable 0.1.1 version, whereas the stable 0.2.0 has just been released.

    In other words, rdfstore-js comes with several parsing bugs that have already been fixed.

    I would volunteer to add N3.js as a submodule to the project and integrate it with the rest of the code, making obtaining the latest version as easy as git submodule update.

    However, I'd like @antoniogarrote's approval before I start working on this. And comments are also welcome, for instance, on the adaptations that were performed for the current integration.

    opened by RubenVerborgh 16
  • NotFound exception for index

    NotFound exception for index

    I tried to use a persistent store in firefox yesterday and I got a not found exception when getting the literal index. Could it be that the indexes are not created and it works on local developer stores because they have been created in the past?

    It is easy to reproduce, just create a store with {persitent:true} and do an insert. I havn't had the time to look into it much yet but I will during the week when time permits.

    Thanks /J

    opened by johlrogge 7
  • Error in btree.js

    Error in btree.js

    Recently I have started to get the following errors:

    rdfstore\src\btree.js:324
                        if(that.comparator(key, node.keys[idx].key)===1) {
                                                              ^
    TypeError: Cannot read property 'key' of null
    
    rdfstore\src\btree.js:334
                        idx = node.numberActives -1;
                                  ^
    TypeError: Cannot read property 'numberActives' of null
    

    I have no idea what leads to this error, and I can't seem to find a pattern to when it occurs.

    opened by MadsHolten 6
  • Does not work with latest node.js unstable

    Does not work with latest node.js unstable

    I'm trying the folowing code : http://pastebin.com/5nPJRqpe Error logs :

    B:\eclipse\workspace\tests>node distant-rdf.js
    
    node.js:207
            throw e; // process.nextTick error, or 'error' event on first tick
                  ^
    Error: No such module
        at Object.<anonymous> (B:\eclipse\workspace\tests\node_modules\rdfstore\node
    _modules\webworker\lib\webworker.js:35:26)
        at Module._compile (module.js:432:26)
        at Object..js (module.js:450:10)
        at Module.load (module.js:351:31)
        at Function._load (module.js:310:12)
        at Module.require (module.js:357:17)
        at require (module.js:368:17)
        at B:\eclipse\workspace\tests\node_modules\rdfstore\index.js:35472:14
        at Object.<anonymous> (B:\eclipse\workspace\tests\node_modules\rdfstore\inde
    x.js:36637:2)
        at Module._compile (module.js:432:26)
    
    

    Versions : node : 0.5.8 npm : 1.0.97 rdfstore: 0.4.2

    Not a javascript (nor node) pro !

    Thanks !

    opened by magnetik 6
  • Naming convention about blank node identifier

    Naming convention about blank node identifier

    Hello,

    The rdfstore.js set the identifier for blank node by adding the prefix ":" with a blankNodeCounter, just like ":1" After the query result from rdfstore.js, I intend to used the jsonld module to generate a json-ld object. Unfortunately, this kind of blank node identifier is not supported by json-ld. I read both specification and can't found any thing about the naming convention for blank node. I do not understand why JSON-LD can only read blank node identifier like this "_:b121", this means after the prefix there must have a charater and then number series.

    I create the issue here so as to given an advisement, whether could rdfstore support this kind of naming convention for blank node in the DB as well.

    Best regards, Kevin

    opened by kevinprotoss 5
  • ?x ?p ?x issue

    ?x ?p ?x issue

    I'm trying to write some queries that match triples having the same resource for the subject and object, i.e. "WHERE {?x ?p ?x}". in the examples below (one CONSTRUCT the other a SELECT) there are no triples that match this pattern and yet the queries are returning results.

    am I missing something here or is this a bug?

    thanks!

    require('rdfstore').create(function(store) {
        store.load(
            'text/n3', 
            '<http://A> <http://B> <http://C>.',
            function(success) {
                store.execute(
                    'CONSTRUCT { ?x ?p ?x } WHERE { ?x ?p ?x }',
                    function(success, results) {
                        results.triples.forEach(function(result){
                           console.log(result.subject.nominalValue,
                                        result.predicate.nominalValue,  
                                        result.object.nominalValue);
                           });
                     }
                );
            }); 
     });
    
    // => http://C http://B http://C
    
    require('rdfstore').create(function(store) {
        store.load(
            'text/n3', 
            '<http://A> <http://B> <http://C>.',
            function(success) {
                store.execute(
                    'SELECT * WHERE { ?x ?p ?x }',
                    function(success, results) {
                        results.forEach(function(result){
                           console.log(result.x.value,
                                        result.p.value);
                           });
                     }
                );
            }); 
    });
    
    // => http://C http://B
    
    opened by cmatheus 5
  • Turtle parser fails for large files

    Turtle parser fails for large files

    After reading that you loaded 100,545 triples into memory for the LUBM benchmark I wanted to try loading my own data into rdfstore. However, store.load fails for a large Turtle file with more than 3,000 triples. The general structure of my data looks like this:

    @prefix cal: <http://127.0.0.1:5984/cal/> .
    @prefix verb: <http://127.0.0.1:5984/cal/verb/> .
    cal:d31615229aa3c0fd05b1c5c25c46a987 verb:adjclose "10829.68" ;
        verb:close "10829.68" ;
        verb:date "2010-10-01" ;
        verb:high "10907.41" ;
        verb:low "10759.14" ;
        verb:open "10789.72" ;
        verb:volume "4298910000" .
    

    Smaller subsets of the data with 100, 300, and 1,000 triples are imported flawlessly in approximately 1 sec, 5 secs, and 17 secs, respectively. For 3,000 triples and more, both Node and Chrome stay unresponsive. I tried to track down the problem and it seems like that the process gets stuck in the parse method of TurtleParser.

    Maybe an event-based parser or chunking would help. In the meantime, could loading the data as JSON be an intermediate solution?

    opened by agrueneberg 5
  • Cannot find module '../node_modules/n3/lib/N3Parser'

    Cannot find module '../node_modules/n3/lib/N3Parser'

    Hello,

    I installed rdfstore in my project using npm install --save rdfstore; however, require('rdfstore') fires the following error:

    Cannot find module '../node_modules/n3/lib/N3Parser'.
    ...
    at Object.<anonymous> ('('basepath)/node_modules/rdfstore/src/rvn3_parser.js:2:16)
    

    The two first lines of rvn3_parser.js are

    (line 1) //var N3Parser = require('n3').Parser;
    (line 2) var N3Parser = require('../node_modules/n3/lib/N3Parser');
    

    When I manually uncomment line 1 and comment line 2, it works. Is there an actual way to avoid the relative inclusion of N3Parser without downgrading rdfstore's version? Did I misunderstand something?

    Thanks,

    Mehdi

    opened by mterdjimi 4
  • store.delete issues error

    store.delete issues error

    When trying to execute store.delete, I get the following error ::

    /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/graph_callbacks.js:71
        this.updateInProgress[event].push(quad);
                             ^
    TypeError: Cannot read property 'deleted' of null
        at Callbacks.CallbacksBackend.nextGraphModification (/home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/graph_callbacks.js:71:26)
        at /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/query_engine.js:1707:43
        at /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/lexicon.js:440:9
        at /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/utils.js:438:26
        at /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/utils.js:420:9
        at /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/utils.js:401:21
        at /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/utils.js:417:13
        at /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/utils.js:434:21
        at /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/lexicon.js:437:13
        at /home/ckristo/rdfstore-js-example/node_modules/rdfstore/src/utils.js:431:20
    
    Process finished with exit code 1
    

    I'm using node.js and the following code:

               // - delete existing statements
                var g = rdfEnv.createGraph();
                g.add(rdfEnv.createTriple(me,
                    rdfEnv.createNamedNode('foaf:mbox'),
                    rdfEnv.createNamedNode('mailto:[email protected]')));
                g.add(rdfEnv.createTriple(me,
                    rdfEnv.createNamedNode('foaf:mbox'),
                    rdfEnv.createNamedNode('mailto:[email protected]')));
                store.delete(g, function(arg1, arg2, arg3) {
                    console.log(arg1);
                    console.log(arg2);
                    console.log(arg3);
                });
    
    opened by ckristo 4
  • store.load not working

    store.load not working

    I really could not get this working with the current version of rdfstore, while it works with some very old one (0.8 I think)

    This is my code:

    rdfstore.create(function (err, store) {
      store.load(mimeType, file, function(err, loaded) {
        console.log("LOADSTORE", err, loaded)
    

    and I get loaded = 0

    my file is:

    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    
    <>
        <http://purl.org/dc/terms/title> "WebID profile of Nicola Greco" ;
        a <http://xmlns.com/foaf/0.1/PersonalProfileDocument> ;
        <http://xmlns.com/foaf/0.1/maker> <#me> ;
        <http://xmlns.com/foaf/0.1/primaryTopic> <#me> .
    
    <#me>
        a <http://xmlns.com/foaf/0.1/Person> ;
        <http://www.w3.org/ns/auth/cert#key> <#key> ;
        <http://www.w3.org/ns/pim/space#preferencesFile> <../Preferences/prefs> ;
        <http://www.w3.org/ns/ui#backgroundImage> <van%20gogh%20gigapixel.png> ;
        <http://xmlns.com/foaf/0.1/img> <nicola%20machine%20drawing.jpg> ;
        <http://xmlns.com/foaf/0.1/knows> <http://melvincarvalho.com/#me> ;
        <http://xmlns.com/foaf/0.1/mbox> <mailto:[email protected]> ;
        <http://xmlns.com/foaf/0.1/name> "Nicola Greco" .
    

    Still, it loades it in the older version :( Any idea?

    opened by nicola 4
  • Bump lodash from 2.4.2 to 4.17.19

    Bump lodash from 2.4.2 to 4.17.19

    Bumps lodash from 2.4.2 to 4.17.19.

    Release notes

    Sourced from lodash's releases.

    4.17.16

    4.0.0

    lodash v4.0.0

    2015 was big year! Lodash became the most depended on npm package, passed 1 billion downloads, & its v3 release saw massive adoption!

    The year was also one of collaboration, as discussions began on merging Lodash & Underscore. Much of Lodash v4 is proofing out the ideas from those discussions. Lodash v4 would not be possible without the collaboration & contributions of the Underscore core team. In the spirit of merging our teams have blended with several members contributing to both libraries.

    For 2016 & lodash v4.0.0 we wanted to cut loose, push forward, & take things up a notch!

    Modern only

    With v4 we’re breaking free from old projects, old environments, & dropping old IE < 9 support!

    4 kB Core

    Lodash’s kitchen-sink size will continue to grow as new methods & functionality are added. However, we now offer a 4 kB (gzipped) core build that’s compatible with Backbone v1.2.4 for folks who want Lodash without lugging around the kitchen sink.

    More ES6

    We’ve continued to embrace ES6 with methods like _.isSymbol, added support for cloning & comparing array buffers, maps, sets, & symbols, converting iterators to arrays, & iterable _(…).

    In addition, we’ve published an es-build & pulled babel-plugin-lodash into core to make tree-shaking a breeze.

    More Modular

    Pop quiz! 📣

    What category path does the bindAll method belong to? Is it

    A) require('lodash/function/bindAll') B) require('lodash/utility/bindAll') C) require('lodash/util/bindAll')

    Don’t know? Well, with v4 it doesn’t matter because now module paths are as simple as

    var bindAll = require('lodash/bindAll');
    

    We’ve also reduced module complexity making it easier to create smaller bundles. This has helped Lodash adoption with libraries like Async & Redux!

    1st Class FP

    With v3 we introduced lodash-fp. We learned a lot & with v4 we decided to pull it into core.

    Now you can get immutable, auto-curried, iteratee-first, data-last methods as simply as

    Commits
    Maintainer changes

    This version was pushed to npm by mathias, a new releaser for lodash since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump acorn from 1.2.2 to 7.1.1

    Bump acorn from 1.2.2 to 7.1.1

    Bumps acorn from 1.2.2 to 7.1.1.

    Commits
    • 6d19489 Mark release 7.1.1
    • 793c0e5 More rigorously check surrogate pairs in regexp validator
    • b5c1787 Fix incorrect comment in regexp parser
    • 12ae8fe Parameterize dummy value and export isDummy
    • fa3ad8c Further refine acorn-walk types
    • 1d50286 Fix some errors in walk types
    • 97801f0 Mark acorn-walk 7.1.1
    • e9372c1 Further clean up walker types
    • de6edeb Remove NarrowNode from walk.d.ts
    • 1d85e7c Fix: acorn-walk type work with acorn's
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • FYI: Move to alternative RDF libraries in JavaScript

    FYI: Move to alternative RDF libraries in JavaScript

    This is a FYI issue for those who still file bugs here. You should definitely not use this library anymore, that was a great effort by Antonio but handing it over to other persons never worked and the original author does not do any work on it anymore.

    If you are looking for RDF libs for JavaScript you should check out implementations of the RDFJS specification.

    opened by ktk 0
Owner
Antonio Garrote
Antonio Garrote
Run SPARQL/SQL queries directly on Virtuoso database with connection pool support.

?? virtuoso-connector Package that allows you to create a direct connection to the Virtuoso database and run queries on it. Connection can be used to

Tomáš Dvořák 6 Nov 15, 2022
Query for CSS brower support data, combined from caniuse and MDN, including version support started and global support percentages.

css-browser-support Query for CSS browser support data, combined from caniuse and MDN, including version support started and global support percentage

Stephanie Eckles 65 Nov 2, 2022
Microsoft-store - Microsoft Store package for LTSC.

Microsoft Store Microsoft Store package for Windows LTSC. Usage Just download the release and double click the exe file. Can be used in Windows LTSC 2

fernvenue 7 Jan 2, 2023
Modren is a modern store for Linux. It includes support for snaps, flatpaks from Flathub, APT packages and DEBs.

v1.0.0 Made with ❤️ for ?? Modren is a modern store for Linux. It includes support for snaps, flatpaks from Flathub, APT packages and DEBs. Download ·

Rudra Saraswat 82 Nov 18, 2022
A RESTful API to support online store.

?? Table of Contents About API Endpoint Get started Installation Running Building for production Running Tests Technology Contributors License ?? Abou

Zeyad Tarek 6 Dec 17, 2022
Multiple file upload plugin with image previews, drag and drop, progress bars. S3 and Azure support, image scaling, form support, chunking, resume, pause, and tons of other features.

Fine Uploader is no longer maintained and the project has been effectively shut down. For more info, see https://github.com/FineUploader/fine-uploader

Fine Uploader 8.2k Jan 2, 2023
The official proxy of Titanium Network with enhanced support for a large majority of sites with hCAPTCHA support. Successor to Alloy Proxy.

Corrosion Titanium Networks main web proxy. Successor to Alloy Installation: npm i corrosion Example: const Corrosion = require('corrosion'); const p

Titanium Network 79 Dec 21, 2022
🟢 OneForAll Support Bot - Is a support bot for the discord server of OFA!

?? OneForAll Support Bot - Is a support bot for the discord server of OFA! Setup You can setup OneForAll Support Bot by simply opening your terminal/c

baby 3 Oct 15, 2022
A website for tracking community support for BIP21 QR codes that support on-chain and lightning bitcoin payments.

BIP21 Microsite This is a WIP microsite to promote the usage of a BIP21 payment URI QR code that can include lightning invoices or offers. Wallet supp

Stephen DeLorme 16 Nov 27, 2022
Persistent key/value data storage for your Browser and/or PWA, promisified, including file support and service worker support, all with IndexedDB. Perfectly suitable for your next (PWA) app.

BrowstorJS ?? ?? ?? Persistent key/value data storage for your Browser and/or PWA, promisified, including file support and service worker support, all

Nullix 8 Aug 5, 2022
A Higher Order Component using react-redux to keep form state in a Redux store

redux-form You build great forms, but do you know HOW users use your forms? Find out with Form Nerd! Professional analytics from the creator of Redux

Redux Form 12.6k Jan 3, 2023
AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.

Please use version 1.x as prior versions has a security flaw if you use user generated data to concat your SQL strings instead of providing them as a

Andrey Gershun 6.1k Jan 9, 2023
jStorage is a simple key/value database to store data on browser side

NB! This project is in a frozen state. No more API changes. Pull requests for bug fixes are welcomed, anything else gets most probably ignored. A bug

Andris Reinman 1.5k Dec 10, 2022
A lightweight clientside JSON document store,

.____ .__ .__ | | _____ __ _ ______ ____ | |__ _____ |__|_______ | | \__ \

Brian LeRoux 2.1k Nov 24, 2022
Bluzelle is a smart, in-memory data store. It can be used as a cache or as a database.

SwarmDB ABOUT SWARMDB Bluzelle brings together the sharing economy and token economy. Bluzelle enables people to rent out their computer storage space

Bluzelle 225 Dec 31, 2022
A Gatsby starter using the latest Shopify plugin showcasing a store with product overview, individual product pages, and a cart

Gatsby Starter Shopify Kick off your next Shopify project with this boilerplate. This starter creates a store with a custom landing page, individual f

Brent Jackson 12 May 12, 2021
classify store using react js✔

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

ali turkaman 7 Dec 10, 2021
Classify Store in React JS 😃

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

matin turkaman 6 Nov 22, 2021
No BS webpack development tool for Shopify themes (online store 2.0)

Shopify Theme Development Tool Development tool for Shopify to create themes for Online Store 2.0. Shopify Theme Development Tool Getting Started Comm

null 6 Oct 14, 2021