Ls LDP Container using LDFlex

I’m trying to play with LDFlex, but I failed to list items inside a folder.

const data = ldflex['']
console.log('data', await data[''])
// logs undefined

So how to read what it contains?

I tried this:

        const data = ldflex[containerURI]
        const items = await data['ldp:contains'].sparql

which gaves me the sparql:

SELECT ?contains WHERE {
  <> <> ?contains.

I tried it on the following ttl file on the playground :

@prefix : <#>.
@prefix m: <>.
@prefix ldp: <>.
@prefix terms: <>.
@prefix XML: <>.
@prefix st: <>.
@prefix tur: <>.

    a ldp:BasicContainer, ldp:Container;
    terms:modified "2019-12-24T03:53:21Z"^^XML:dateTime;
        <%2524%253A%252FStoryList>, <%2524%253A%252FStoryList.metadata>,
        m:Test, <Test.metadata>, m:Test123, <Test123.metadata>;
    st:mtime 1577159601.427;
    st:size 4096.

With no result.
And I found that, if I change

@prefix : <#>.
@prefix m: <>.


@prefix : <#>.
@prefix m: <>.

then I’m able to get the result.

So the problem is <>, it should be <> to let LDFlex work.
Maybe ldflex can add a function that enables me to replace <> with <> ?

I think it’s the missing trailing slash. This works for me in ldflex playground:


Thank you @aveltens ! That is very tricky!

When trust an origin, we should not add slash: I should trust http://localhost:8080, not http://localhost:8080/

Slash problems are so tricky!

Yes indeed. It’s helpful to understand the several parts oft an URI. While the origin only consists oft scheme+host+port a ressource is identified with a full URI including path, query and fragment. But even then trailing slashes are easily overlooked…

Just to note, we are going to improve the trusted applications in the data browsers by automatically remove the trailing slash when people accidentally add it -