# Problem reading files from the pod

**URL:** https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819
**Category:** Build a Solid App
**Created:** [March 30, 2020, 4:19pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819 "2020-03-30T16:19:50Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![aitorllanos99](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aitorllanos99/32/1537_2.png) [@aitorllanos99](https://forum.solidproject.org/u/aitorllanos99)
#### Post date: [March 30, 2020, 4:19pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/1 "2020-03-30T16:19:50Z")

</div>

Hi everybody,

We are trying to access to some routes in our pods, but we cant manage to access to them.  
we are trying to acces obtaining the document but we cant access to the route since we are on the routes folder

 ![Captura%20de%20pantalla%20(53)](https://europe1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/0/0c7703082c96691c5b49e2bf1d4240e149b8326e.png)  
We are news in Solid, so im sorry if its a really basic question, and we appreciate your help.  
If you need any other folder or part of code you can find it here: [https://github.com/Arquisoft/viade\_es5c/tree/RDF](https://github.com/Arquisoft/viade_es5c/tree/RDF)

---

<div class="post-metadata">

### Author: ![aitorllanos99](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aitorllanos99/32/1537_2.png) [@aitorllanos99](https://forum.solidproject.org/u/aitorllanos99)
#### Post date: [March 30, 2020, 4:41pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/2 "2020-03-30T16:41:26Z")

</div>

The route inside the pod is this:

 ![PNG](https://europe1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/1/149e82ae39a5b6b95b59124b8237e98100cab3d9.jpeg)

---

<div class="post-metadata">

### Author: ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)
#### Post date: [March 30, 2020, 4:46pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/3 "2020-03-30T16:46:34Z")

</div>

Hi @aitorllanos99, judging by your second screenshot, your route is in `/public/viade/routes/otro`. However, on [this line](https://github.com/Arquisoft/viade_es5c/blob/33a008c49606bfd8c41c831fd78cc66eb57d9fb5/src/parseo/parser/parserRDFToRoute/parserRDFToRoute.js#L43) you read the value from `/rutas/` - which does not exist. Thus, try `fc.readFolder(storage + 'public/viade/routes/otro')` instead, and see where that gets you 🙂

---

<div class="post-metadata">

### Author: ![aitorllanos99](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aitorllanos99/32/1537_2.png) [@aitorllanos99](https://forum.solidproject.org/u/aitorllanos99)
#### Post date: [March 31, 2020, 8:51am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/4 "2020-03-31T08:51:46Z")

</div>

Hi @Vincent first of all thanks for answering!

Yeah we had already changed it but we didnt push it, im sorry to dont say it 😅

We have the problem when we try to get the subject #Route from the pod, because it doesnt find it, and we dont know why.

Again, thanks for answering!

---

<div class="post-metadata">

### Author: ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)
#### Post date: [March 31, 2020, 9:49am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/5 "2020-03-31T09:49:45Z")

</div>

Alright, well… Is there a place where we _can_ see the current code? That would make it easier to help…

So again, judging by your second screenshot, it looks like the route is actually called `#myRoute`, rather than `#Route`? That would explain why you can’t find it 🙂

---

<div class="post-metadata">

### Author: ![aitorllanos99](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aitorllanos99/32/1537_2.png) [@aitorllanos99](https://forum.solidproject.org/u/aitorllanos99)
#### Post date: [March 31, 2020, 10:01am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/6 "2020-03-31T10:01:57Z")

</div>

Yes, weve already pushed it.  
The link is [https://github.com/Arquisoft/viade\_es5c/tree/RDF](https://github.com/Arquisoft/viade_es5c/tree/RDF)

This code is in src/parseo/parserRDFToRoute

We changed that aswell, really sorry for the inconveniences for showing you an older code.  
Thank you very much for your help.

---

<div class="post-metadata">

### Author: ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)
#### Post date: [March 31, 2020, 10:35am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/7 "2020-03-31T10:35:21Z")

</div>

Thanks for the updated link. So [this line](https://github.com/Arquisoft/viade_es5c/blob/d370f5c24119a2bca1a8cbf80550cad86addc514/src/parseo/parser/parserRDFToRoute/parserRDFToRoute.js#L42) still says you’re looking in `public/viade/routes` - so without `/otro`. Have you tried `public/viade/routes/otro` as well?

If you did, what does the `console.log("RUTISA:" + route);` output?

---

<div class="post-metadata">

### Author: ![aitorllanos99](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aitorllanos99/32/1537_2.png) [@aitorllanos99](https://forum.solidproject.org/u/aitorllanos99)
#### Post date: [March 31, 2020, 10:40am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/8 "2020-03-31T10:40:58Z")

</div>

Yeah we tried, but its says that its null when we included /otro in the url of the folder.

about the output of the console it says.

 ![rutisa](https://europe1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/9/9c07e424686d28673194d37e7464935fd66cdbb2.png)

There is where we are stucked. We cant accces to the properties of the route from there.

Again, really thankful for your reply

---

<div class="post-metadata">

### Author: ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)
#### Post date: [March 31, 2020, 11:15am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/9 "2020-03-31T11:15:37Z")

</div>

Alright, that looks good! You can access the properties of that route using the listed methods, e.g. `route.getString('http://xmlns.com/foaf/0.1/name')` and `route.getRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#type')`.

(I’m making some assumptions here about what your data looks like - if you have a link to the Pod containing the data in your second screenshot, I can verify that.)

---

<div class="post-metadata">

### Author: ![aitorllanos99](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aitorllanos99/32/1537_2.png) [@aitorllanos99](https://forum.solidproject.org/u/aitorllanos99)
#### Post date: [March 31, 2020, 11:20am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/10 "2020-03-31T11:20:16Z")

</div>

Thank you very much!.  
The file to verify is in [https://aitorllanos99.solid.community/](https://aitorllanos99.solid.community/).

---

<div class="post-metadata">

### Author: ![aitorllanos99](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aitorllanos99/32/1537_2.png) [@aitorllanos99](https://forum.solidproject.org/u/aitorllanos99)
#### Post date: [March 31, 2020, 11:26am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/11 "2020-03-31T11:26:05Z")

</div>

Hi vincent,  
We´ve tried what you said about this:

> [@Vincent](#):
>
> route.getString(‘[FOAF Vocabulary Specification](http://xmlns.com/foaf/0.1/name)’)

And it returns us null… Would you know why?

---

<div class="post-metadata">

### Author: ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)
#### Post date: [March 31, 2020, 11:44am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/12 "2020-03-31T11:44:01Z")

</div>

Yes, hovering over `name` at [https://aitorllanos99.solid.community/public/viade/routes/otro](https://aitorllanos99.solid.community/public/viade/routes/otro), I see that it’s not actually a `foaf:name` but a `schema:name`, so it would have to be `route.getString('http://schema.org/name')`.

---

<div class="post-metadata">

### Author: ![Borjarguez](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/borjarguez/32/1536_2.png) [@Borjarguez](https://forum.solidproject.org/u/Borjarguez)
#### Post date: [March 31, 2020, 11:52am UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/13 "2020-03-31T11:52:17Z")

</div>

Hi @Vincent ! First of all thank you so much for your help, it is very important for us. We have tried what you have just said but it doesn’t work either… Here it is a new screenshot of what the code returns us:

 ![rutisanamedoesntwork](https://europe1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/0/05942909994d4edf7aaec46d53ec3791deb0d68e.png)

You probably think that we don’t know nothing about this topic, but we are new and anyone has explained us how this “world” works. Again, thank you so much for spending your time helping us!!

---

<div class="post-metadata">

### Author: ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)
#### Post date: [March 31, 2020, 1:40pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/14 "2020-03-31T13:40:54Z")

</div>

No problem, happy to see you venturing into the world of Solid and persisting despite it all being new 🙂

Alright, so there’s one more thing that’s going wrong here. Looking at [the route file](https://aitorllanos99.solid.community/public/viade/routes/otro), its contents is this:

```auto
@prefix viade: <http://arquisoft.github.io/viadeSpec/>.
@prefix : <http://example.org/>.
@prefix schema: <http://schema.org/>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.

:myRoute a viade:Route ;schema:name "otro" ;viade:point [schema:latitude -5.33935546875 ;schema:longitude 42.56926437219384 ;viade:order 1] ;viade:point [schema:latitude -5.80078125 ;schema:longitude 41.902277040963696 ;viade:order 2] ;viade:point [schema:latitude -4.85595703125 ;schema:longitude 42.049292638686836 ;viade:order 3] .

```

Most important here is this line:

```
@prefix : <http://example.org/>.

```

This means that, later in that document where it says `:myRoute`, the `:` gets replaced by `http://example.org/`. This means that the actual identifier of your route is `http://example.org/myRoute`, rather than `#myRoute`.

You can find a working code sample that uses that identifier here: [https://codesandbox.io/s/tripledoc-quickstart-8plts?fontsize=14&hidenavigation=1&theme=dark](https://codesandbox.io/s/tripledoc-quickstart-8plts?fontsize=14&hidenavigation=1&theme=dark)

However, the actual fix would be to replace that bit in your route with:

```
    @prefix : <#>.

```

Then, the old version should (hopefully) work.

---

<div class="post-metadata">

### Author: ![Borjarguez](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/borjarguez/32/1536_2.png) [@Borjarguez](https://forum.solidproject.org/u/Borjarguez)
#### Post date: [March 31, 2020, 2:52pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/15 "2020-03-31T14:52:04Z")

</div>

Thank you so much!! We are starting to understand more or less how RDF works. Now we know how to obtain things from schema like our route’s name. But for example, to obtain our route’s points seems to be different. We thought that the “object” route had some property that returned its points but seem not to work like that.

We also know how to obtain the points. As point has viade’s type, we deduced that ‘viade:’ would be replaced for its prefix, as you explained us before. So we did this:

**const points = routeDocument.getSubject(‘[http://arquisoft.github.io/viadeSpec/point](http://arquisoft.github.io/viadeSpec/point)’);**

But for a reason we don’t understand yet, we can’t have its values as you explained us with the route’s name. Maybe a different method? ( i talk about a method like ‘getSubject()’) Thanks very much!!

---

<div class="post-metadata">

### Author: ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)
#### Post date: [March 31, 2020, 3:17pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/16 "2020-03-31T15:17:48Z")

</div>

Great to hear! And yes, your points are a bit different, but I figured I’d first help you with the first steps so you can gradually learn how things fit together 🙂

In RDF terms, the points on your route are _blank nodes_ (i.e. they don’t have a URL), whereas the route itself is a _named node_ (i.e. it has a URL: currently `http://example.org/myRoute`, though it should’ve been `https://aitorllanos99.solid.community/public/viade/routes/otro#myRoute`).

So we’ve been calling e.g. `getString()` to get properties of the route, but how can we do the same for points on that route?

In Tripledoc, the library you’re using to access the data, you can access those points through `getLocalSubject()` (to access one of them) and `getAllLocalSubjects()` (to access multiple).

So in code, you could get access to the points using:

```javascript
const points = route.getAllLocalSubjects('http://arquisoft.github.io/viadeSpec/point');

```

And then you can read values of a single point using the same methods you can use on the route, e.g.

```javascript
const firstPointOrder = points[0].getInteger('http://arquisoft.github.io/viadeSpec/order');

```

A working code example can be found here:

> **[tripledoc-quickstart - CodeSandbox](https://codesandbox.io/s/tripledoc-quickstart-sko7c?fontsize=14&hidenavigation=1&theme=dark)**
>
> tripledoc-quickstart using rdf-namespaces, solid-auth-client, tripledoc

---

<div class="post-metadata">

### Author: ![aitorllanos99](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aitorllanos99/32/1537_2.png) [@aitorllanos99](https://forum.solidproject.org/u/aitorllanos99)
#### Post date: [March 31, 2020, 3:29pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/17 "2020-03-31T15:29:39Z")

</div>

Vincent you dont know how really thankful we are for your help and for your lessons about RDF and how to work with it, this was really fructiferous, and we know much more about Solid.  
From our heart, thanks in name of all our group.

---

<div class="post-metadata">

### Author: ![Borjarguez](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/borjarguez/32/1536_2.png) [@Borjarguez](https://forum.solidproject.org/u/Borjarguez)
#### Post date: [March 31, 2020, 3:32pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/18 "2020-03-31T15:32:20Z")

</div>

@Vincent Thank you so so much for your advices!! Thanks to you i hate a little less this university project hahaha. Seriously, you don’t know how much you had helped us.

---

<div class="post-metadata">

### Author: ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)
#### Post date: [March 31, 2020, 4:17pm UTC](https://forum.solidproject.org/t/problem-reading-files-from-the-pod/2819/19 "2020-03-31T16:17:20Z")

</div>

Happy to hear you’re making progress! If you encounter more challenges, be sure to start a new topic in this forum! There’s plenty of people willing to help, and it’ll also be helpful to others who encounter the same problems in the future.
