Giter Site home page Giter Site logo

tripledoc's Introduction

tripledoc

Read, create and edit RDF documents on Solid Pods.

Tripledoc aims to mesh well with the way of thinking of developers that are not necessarily well-versed in RDF or Linked Data, and just want to store their data on a Solid Pod. Its goal is to make it as easy as possible to get started writing Solid apps, and therefore tries to avoid magic, is extensively documented, and publishes type declarations for editors that support TypeScript.

It is recommended to use Tripledoc in combination with the package rdf-namespaces.

Installation

npm install tripledoc solid-auth-client

Usage

import { fetchDocument } from 'tripledoc';
import { foaf } from 'rdf-namespaces';

fetchDocument('https://www.w3.org/People/Berners-Lee/card')
.then(profileDoc => {
  const profile = profileDoc.getSubject('https://www.w3.org/People/Berners-Lee/card#i');
  const name = profile.getString(foaf.name);
  console.log('The name in this profile is:', name);

  profile.addRef(foaf.knows, 'https://vincentt.inrupt.net/profile/card#me');
  profile.addString(foaf.nick, 'timbl');

  // Credentials are included [1] in this request, so make sure those are set
  // properly if needed. The package solid-auth-client [2] might be of assistance
  // here.
  // [1] https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Sending_a_request_with_credentials_included
  // [2] https://www.npmjs.com/package/solid-auth-client
  profileDoc.save().then(() => console.log('Profile updated!'));
});

Full documentation

Browser support

Tripledoc uses relatively modern Javascript features that will work in all commonly-used browsers, except Internet Explorer. If you need support for Internet Explorer, it is recommended to pass it through a tool like Babel.

Changelog

See the release notes.

License

MIT © Inrupt

tripledoc's People

Contributors

vinnl avatar rubenverborgh avatar pmcb55 avatar

Stargazers

muuk avatar

Watchers

James Cloos avatar  avatar

Forkers

liuwei77

tripledoc's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.