1

I am trying to retrieve the organization-name, or any data from the following endpoint.

https://isumotest.inrupt.net/profile/card#me

However whenever i try to grab anything it always comes back as undefined

const $rdf = require('rdflib')
const store  = $rdf.graph();

const me = store.sym('https://isumotest.inrupt.net/profile/card#me');
const profile = me.doc();       //i.e. store.sym(''https://example.com/alice/card#me')

const VCARD = new $rdf.Namespace('http://www.w3.org/2006/vcard/ns#');
const FOAF = new $rdf.Namespace('http://xmlns.com/foaf/0.1/');

let name = store.any(me, VCARD('organization-name'));
console.log(name);
console.log('Request Ended');

For example:

$ node app.js
undefined
Request Ended

Any help is very much appreciated, i have been stuck on this for quite a while.

TallTed
  • 9,069
  • 2
  • 22
  • 37
Morphasis
  • 1,343
  • 1
  • 12
  • 25
  • 2
    if I'm not totally wrong here, you have to load the data into the store . `store.sym` just returns the node identified by the URI. You should walk through the tutorial again: https://github.com/solid/solid-tutorial-rdflib.js - especially the section with loading data into the store is important for you I'd say. – UninformedUser Apr 10 '19 at 03:15
  • 3
    define `var fetcher = new $rdf.Fetcher(store, timeout)` and then do `fetcher.nowOrWhenFetched('https://isumotest.inrupt.net/profile/card#me', function(ok, body, xhr) { if (!ok) { console.log("Oops, something happened and couldn't fetch data"); } else { const me = store.sym('https://isumotest.inrupt.net/profile/card#me'); let name = store.any(me, VCARD('organization-name')); console.log(name); } })` – UninformedUser Apr 10 '19 at 07:09
  • 2
    @AKSW That totally did what i needed thank you for helping out my simple doc confusion. You should probably post it as a answer to this question and get your free internet points :) – Morphasis Apr 10 '19 at 09:15

0 Answers0