# How to read data from RDF file from Solid POD?

**URL:** <https://forum.solidproject.org/t/how-to-read-data-from-rdf-file-from-solid-pod/1332>\
**Category:** Solid App Development FAQs\
**Created:** [February 22, 2019, 3:45pm UTC](https://forum.solidproject.org/t/how-to-read-data-from-rdf-file-from-solid-pod/1332 "2019-02-22T15:45:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoaib.sarfraz](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@shoaib.sarfraz](https://forum.solidproject.org/u/shoaib.sarfraz)\
**Post date:** [February 22, 2019, 3:45pm UTC](https://forum.solidproject.org/t/how-to-read-data-from-rdf-file-from-solid-pod/1332/1 "2019-02-22T15:45:34Z")

</div>

I’ am able to read rdf file form Solid POD but could’nt find a solution to show data inside the file to fornt-end.

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [February 22, 2019, 5:43pm UTC](https://forum.solidproject.org/t/how-to-read-data-from-rdf-file-from-solid-pod/1332/2 "2019-02-22T17:43:46Z")

</div>

The main tool for parsing RDF data in Solid is rdflib.js. You can use rdflib.js directly by using it’s graph(), load() and parse() methods or you can use it through solid-file-client’s fetchAndParse() method which does the graph, load and parse for you and returns an rdflib graph/kb object that can be queried using rdflib methods like each() and any(). See below for an example of using fetchAndParse() . To read more about rdflib’s methods, see the tutorials listed on [https://github.com/linkeddata/rdflib.js/](https://github.com/linkeddata/rdflib.js/).

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [February 22, 2019, 6:12pm UTC](https://forum.solidproject.org/t/how-to-read-data-from-rdf-file-from-solid-pod/1332/3 "2019-02-22T18:12:03Z")

</div>

Here’s a complete working example of [solid-file-client](https://github.com/jeff-zucker/solid-file-client)’s fetchAndParse() method:

```javascript
const fc = require('solid-file-client')
var subject = "https://jeffz.solid.community/profile/card#me"
var predicate = 'http://xmlns.com/foaf/0.1/name'

fc.fetchAndParse( subject ).then( store => {
    subject = store.sym(subject)
    predicate = store.sym(predicate)
    var name = store.any(subject,predicate).value
    if(name==="Jeff Zucker") console.log("fetched and parsed");
    else console.log("fecthed but could not parse as expected");
}, err => console.log("could not fetch : "+err) ) ;

```

---

<div class="post-metadata">

**Author:** ![bourgeoa](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/bourgeoa/32/291_2.png) [@bourgeoa](https://forum.solidproject.org/u/bourgeoa)\
**Post date:** [February 22, 2019, 9:19pm UTC](https://forum.solidproject.org/t/how-to-read-data-from-rdf-file-from-solid-pod/1332/4 "2019-02-22T21:19:19Z")

</div>

What is the meaning of `kb` ?

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [February 22, 2019, 9:25pm UTC](https://forum.solidproject.org/t/how-to-read-data-from-rdf-file-from-solid-pod/1332/5 "2019-02-22T21:25:52Z")

</div>

It is the rdflib.js store object created by $rdf.graph(). I think of the “kb” as standing for Knowledge Base, but I have the feeling that may be a personal mnemonic for some other abbreviation I once knew. 🙂 Abd I’ve now replaced it with the much clearer “store” in the example, thanks for pointing it out.
