Skip to content

🎫 Get a webid in any linked data format for browsers and Node.js

Notifications You must be signed in to change notification settings

nicola/webid-get

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

webid-get

Get a WebID graph

Context

A WebID is URL that describes the identity of a user on the web. Getting WebID's data is as easy as a curl request

$ curl -X GET https://nicola.databox.me/profile/card#me
# @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> .

However, a WebID can point to other WebIDs of the same user (through sameAs and seeAlso), or to the user preferences and you very likely, you will need to follow these links to get the user data you want. This code could get very long and redundant, especially if you are using this in multiple projects. So, why not have a very simple command that does all of that for you?

Install

$ npm install --save webid-get

Usage

var webidGet = require('webid-get')

var uri = 'http://www.w3.org/People/Berners-Lee/card#me'
webidGet(uri, function (err, graph) {
  // webid will be a `rdf-ext` graph
})

var graph = rdf.createGraph()
webidGet(uri, graph, function (err) {
  // webid will be a `rdf-ext` graph
})

License

MIT © Nicola Greco 2015

About

🎫 Get a webid in any linked data format for browsers and Node.js

Resources

Stars

Watchers

Forks

Packages

No packages published