Skip to content

mukti107/rdf-orm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object Relation Mapping for RDF

Wrapper for RDF database

Installation

NPM

npm i -s rdf-orm

Yarn

yarn add rdf-orm

##Initializae connection

import {initConnection} from 'rdf-orm';
initConnection({baseUrl: 'http://localhost:3030/123'});

Define a Data Model

import {Model} from 'rdf-orm';
class Post extends Model{
    table='posts';
}

Create new Record

const post:Post|any = new Post;
post.title = "Sample post";
post.save();

Retrive Record by ID

const post:Post|any =await Post.find(<post_id>);
console.log(post);

Delete a Record

const post:Post|any =await Post.find(<post_id>);
post.delete();

Get all Records

const posts:Post|any =await Post.all();
console.log(posts);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published