0.1.0 • Published 7 years ago

protograph v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Protograph

Protograph is a (very) simple RDF style graph database.

Create a client by saying where the data should be stored:

   var protograph = require('protograph');
   var proto = protograph.create({directory:'/mydata/testGraph/'});

All data will then be stored under the testGraph directory.

Currently you can only store resource-predicate-resource facts E.g:

    var jeff = {r:'http://mynamespace/people#Jeff'};
    var likes = {r:'http://mynamespace/ontology/likes'};
    var cheese = {r:'http://mynamespace/foodstuff#cheese'};
    proto.put([jeff, likes, cheese], function(err) {
        // Check if everything went OK.
    });

And then query on them:

   proto.get([jeff, likes, null], // Jeff likes ?
      function(foundFact, itemCallback) {
          // Do what you want with each Jeff likes X fact.
          itemCallback();
      },
      function(err) {
          // Called after all things Jeff likes.
      });

You cannot currently:

  • Store string objects.
  • Store number objects.
  • Query based on the object, E.g. '? likes cheese'.

Roadmap:

  • Delete facts.
  • Dump all facts.
  • Language codes for strings.
  • Type codes for numbers.

If you do not specify a directory option, the value in the environment variable PROTOGRAPH_DIRECTORY will be used. If this environment variable is not present ~/protograph_data will be used.

0.1.0

7 years ago

0.0.6

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago